anthropics / anthropics/claude-code-action

SDK execution error

Đang mở
#893 10 bình luận 35 reaction 0 người được giao Xem trên GitHub
area:installation bug p1 provider:1p
Ngôn ngữ chính
TypeScript
Star
8.9k
Fork
2.1k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

**Describe the bug**

I'm running the action v1.0.41 (commit SHA: 70e16deb18402428bd09e08d1ec3662a872e3c72) on Node v20 and get an SDK execution error with an error message that I can't understand.

**Expected behavior**

Runs without exception

**Screenshots**

Logs from https://github.com/giantswarm/architect/actions/runs/21588031232/job/62202039585?pr=1271 :

```
Running Claude with prompt from file: /home/runner/work/_temp/claude-prompts/claude-prompt.txt
SDK options: {
"allowedTools": [
"Bash"
],
"systemPrompt": {
"type": "preset",
"preset": "claude_code"
},
"pathToClaudeCodeExecutable": "",
"extraArgs": {
"max-turns": "10",
"model": "claude-haiku-4-5-20251101"
},
"settingSources": [
"user",
"project",
"local"
]
}
{
"type": "system",
"subtype": "init",
"message": "Claude Code initialized",
"model": "claude-haiku-4-5-20251101"
}
{
"type": "result",
"subtype": "success",
"is_error": true,
"duration_ms": 243,
"num_turns": 1,
"total_cost_usd": 0,
"permission_denials": []
}
SDK execution error: 14 | depsCount: ${Q},
15 | deps: ${$}}`};var Pj={keyword:"dependencies",type:"object",schemaType:"object",error:EB.error,code(X){let[Q,$]=Sj(X);RB(X,Q),IB(X,$)}};function Sj({schema:X}){let Q={},$={};for(let Y in X){if(Y==="__proto__")continue;let W=Array.isArray(X[Y])?Q:$;W[Y]=X[Y]}return[Q,$]}function RB(X,Q=X.schema){let{gen:$,data:Y,it:W}=X;if(Object.keys(Q).length===0)return;let J=$.let("missing");for(let G in Q){let H=Q[G];if(H.length===0)continue;let B=(0,W4.propertyInData)($,Y,G,W.opts.ownProperties);if(X.setParams({property:G,depsCount:H.length,deps:H.join(", ")}),W.allErrors)$.if(B,()=>{for(let z of H)(0,W4.checkReportMissingProp)(X,z)});else $.if(fY._`${B} && (${(0,W4.checkMissingProp)(X,H,J)})`),(0,W4.reportMissingProp)(X,J),$.else()}}EB.validatePropertyDeps=RB;function IB(X,Q=X.schema){let{gen:$,data:Y,keyword:W,it:J}=X,G=$.name("valid");for(let H in Q){if((0,bj.alwaysValidSchema)(J,Q[H]))continue;$.if((0,W4.propertyInData)($,Y,H,J.opts.ownProperties),()=>{let B=X.subschema({keyword:W,schemaProp:H},G);X.mergeValidEvalu
16 | `))X=Z0(X);let Y=`${new Date().toISOString()} [${Q.toUpperCase()}] ${X.trim()}
17 | `;if(WW()){d7(Y);return}_U().write(Y)}function GW(){return JW()??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??YW(V4(),"debug",`${s7()}.txt`)}var xU=k1(()=>{if(process.argv[2]==="--ripgrep")return;try{let X=GW(),Q=z9(X),$=YW(Q,"latest");if(!n0().existsSync(Q))n0().mkdirSync(Q);if(n0().existsSync($))try{n0().unlinkSync($)}catch{}n0().symlinkSync(X,$)}catch{}});var lU=!1;function F0(X,Q){let $=performance.now();try{return Q()}finally{performance.now()-$>B9}}var mU={cwd(){return process.cwd()},existsSync(X){return F0(`existsSync(${X})`,()=>h.existsSync(X))},async stat(X){return yU(X)},async readdir(X){return gU(X,{withFileTypes:!0})},async unlink(X){return fU(X)},async rmdir(X){return hU(X)},async rm(X,Q){return uU(X,Q)},statSync(X){return F0(`statSync(${X})`,()=>h.statSync(X))},lstatSync(X){return F0(`lstatSync(${X})`,()=>h.lstatSync(X))},readFileSync(X,Q){return F0(`readFileSync(${X})`,()=>h.readFileSync(X,{encoding:Q.encoding}))},readFileBytesSync(X){return F0(`readFileBytesSync(${X})`,()=>h.readFileSync(X))},readS
18 | `),F4}function N1(X){let Q=tU();if(!Q)return;let Y=`${new Date().toISOString()} ${X}
19 | `;nU(Q,Y)}function zW(X,Q){let $={...X};if(Q){let Y={sandbox:Q};if($.settings)try{Y={...L4($.settings),sandbox:Q}}catch{}$.settings=Z0(Y)}return $}class XX{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(X){this.options=X;this.abortController=X.abortController||N6(),this.initialize()}getDefaultExecutable(){return j6()?"bun":"node"}spawnLocalProcess(X){let{command:Q,args:$,cwd:Y,env:W,signal:J}=X,G=W.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr?"pipe":"ignore",H=aU(Q,$,{cwd:Y,stdio:["pipe","pipe",G],signal:J,env:W,windowsHide:!0});if(W.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr)H.stderr.on("data",(z)=>{let K=z.toString();if(N1(K),this.options.stderr)this.options.stderr(K)});return{stdin:H.stdin,stdout:H.stdout,get killed(){return H.killed},get exitCode(){return H.exitCode},kill:H.kill.bind(H),on:H.on.bind(H),once:H.once.bind(H),off:H.off.bind(H)}}initialize(){try{let{additionalDirectories:X=[],agent:Q,betas:$,cwd:Y,execu

error: Claude Code process exited with code 1
at $ (/home/runner/work/_actions/anthropics/claude-code-action/70e16deb18402428bd09e08d1ec3662a872e3c72/base-action/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:7668)
at emit (node:events:98:22)
at #handleOnExit (node:child_process:520:14)
```

**Workflow yml file**

Reusable workflow: https://github.com/giantswarm/github-workflows/blob/1d37c1d2e31ec10e2104b233b7ef002486c5add6/.github/workflows/auto-update-changelog.yaml

Calling workflow: https://github.com/giantswarm/architect/blob/a1b7c20ee54da0626ca34fed47cbc793c8a5b955/.github/workflows/auto-update-changelog.yaml

**API Provider**

[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.