fix: wire max_turns input through run.ts to SDK#1179
Closed
qozle wants to merge 2 commits intoanthropics:mainfrom
Closed
fix: wire max_turns input through run.ts to SDK#1179qozle wants to merge 2 commits intoanthropics:mainfrom
qozle wants to merge 2 commits intoanthropics:mainfrom
Conversation
…unners Non-ephemeral self-hosted runners retain ~/.claude state across workflow runs. On the second run, 'claude plugin marketplace add' exits 1 with "already installed" and the action fails before any plugins are installed. Capture stdout/stderr in addMarketplace (mirroring to parent process so output remains visible), and resolve instead of rejecting when the output contains "already installed". Any other non-zero exit still propagates as an error. Tests: update assertions for the new stdio tuple, add two new cases covering the idempotent skip and non-matching failure passthrough. Fixes anthropics#1057. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
run.ts called runClaude() without maxTurns, so all runs using the tag/run entrypoint silently capped at the SDK default of 10 turns regardless of any max_turns or --max-turns configuration. - Add max_turns input to action.yml and base-action/action.yml - Map INPUT_MAX_TURNS env var in both action.yml run steps - Pass maxTurns: process.env.INPUT_MAX_TURNS in run.ts runClaude() call base-action/src/index.ts already passed maxTurns correctly; this brings run.ts into parity. Fixes anthropics#1177
Contributor
Author
|
Closing — superseded by #1184 which implements the same fix more minimally (6 lines vs 122). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
run.ts(the tag/run entrypoint) calledrunClaude()without passingmaxTurns, so all runs using this entrypoint silently capped at the SDK default of 10 turns — regardless of anymax_turnsinput or--max-turnsinclaude_args.Trace:
run.ts:268callsrunClaude(path, { claudeArgs, model, ... })—maxTurnsmissingparse-sdk-options.ts:260seesmaxTurns: undefined→ passesundefinedto SDKReached maximum number of turns (10)base-action/src/index.tsalready passesmaxTurns: process.env.INPUT_MAX_TURNScorrectly; this bringsrun.tsinto parity.Changes
action.yml: addmax_turnsinputbase-action/action.yml: addmax_turnsinput +INPUT_MAX_TURNSenv mappingsrc/entrypoints/run.ts: passmaxTurns: process.env.INPUT_MAX_TURNStorunClaude()Testing
Set
max_turns: 25in a workflow using the action. Previously the run would terminate at 10 turns withReached maximum number of turns (10). With this fix the SDK receivesmaxTurns: 25and runs to the configured limit.Fixes #1177