From 56ba89db3de4325a42d39af128f783c9fbb6fa76 Mon Sep 17 00:00:00 2001 From: Max Flanagan Date: Sun, 5 Apr 2026 19:45:25 -0400 Subject: [PATCH] fix: wire max_turns input through to SDK in run.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #1177 Co-Authored-By: Claude Sonnet 4.6 --- action.yml | 5 +++++ src/entrypoints/run.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/action.yml b/action.yml index 460a0a364..3a8ba7111 100644 --- a/action.yml +++ b/action.yml @@ -86,6 +86,10 @@ inputs: required: false default: "false" + max_turns: + description: "Maximum number of agentic turns for Claude to use" + required: false + default: "" claude_args: description: "Additional arguments to pass directly to Claude CLI" required: false @@ -268,6 +272,7 @@ runs: INPUT_EXPERIMENTAL_SLASH_COMMANDS_DIR: ${{ github.action_path }}/slash-commands INPUT_PATH_TO_CLAUDE_CODE_EXECUTABLE: ${{ inputs.path_to_claude_code_executable }} INPUT_PATH_TO_BUN_EXECUTABLE: ${{ inputs.path_to_bun_executable }} + INPUT_MAX_TURNS: ${{ inputs.max_turns }} INPUT_SHOW_FULL_OUTPUT: ${{ inputs.show_full_output }} DISPLAY_REPORT: ${{ inputs.display_report }} INPUT_PLUGINS: ${{ inputs.plugins }} diff --git a/src/entrypoints/run.ts b/src/entrypoints/run.ts index 2ab42f1a4..0a5dd8aa1 100644 --- a/src/entrypoints/run.ts +++ b/src/entrypoints/run.ts @@ -268,6 +268,7 @@ async function run() { const claudeResult: ClaudeRunResult = await runClaude(promptConfig.path, { claudeArgs: prepareResult.claudeArgs, appendSystemPrompt: process.env.APPEND_SYSTEM_PROMPT, + maxTurns: process.env.INPUT_MAX_TURNS, model: process.env.ANTHROPIC_MODEL, pathToClaudeCodeExecutable: process.env.INPUT_PATH_TO_CLAUDE_CODE_EXECUTABLE,