Skip to content

fix: wire max_turns input through to SDK in run.ts#1184

Open
qozle wants to merge 1 commit intoanthropics:mainfrom
qozle:fix/wire-max-turns-to-sdk
Open

fix: wire max_turns input through to SDK in run.ts#1184
qozle wants to merge 1 commit intoanthropics:mainfrom
qozle:fix/wire-max-turns-to-sdk

Conversation

@qozle
Copy link
Copy Markdown
Contributor

@qozle qozle commented Apr 5, 2026

Summary

run.ts never passes maxTurns to runClaude(), so the SDK omits --max-turns from the CLI args and the CLI defaults to 10 turns. The base-action entrypoint already wires this correctly — run.ts was just missing it.

  • Added max_turns input to action.yml
  • Passed INPUT_MAX_TURNS through the composite step env block
  • Added maxTurns to the runClaude() call in run.ts

Note: --max-turns via claude_args does work correctly (the SDK passes extraArgs through to the CLI). This fix adds the dedicated max_turns input for discoverability and consistency with the base-action.

Test plan

  • bun run typecheck passes
  • bun test passes (664/664)
  • bun run format:check passes
  • Verify in a live workflow: max_turns: 50 allows Claude beyond 10 turns

Fixes #1177

The main entrypoint (run.ts) never passes maxTurns to runClaude(), so
the SDK omits --max-turns from the CLI args and the CLI defaults to 10
turns.  The base-action entrypoint wires this correctly — run.ts was
just missing it.

- Add max_turns input to action.yml
- Pass INPUT_MAX_TURNS through the composite step env block
- Add maxTurns to the runClaude() call in run.ts

Fixes anthropics#1177

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

max_turns is never passed to SDK in run.ts, defaults to 10

1 participant