From 0f1fe5ef851a13d28734e675cf8504f540ba5d93 Mon Sep 17 00:00:00 2001 From: Max Flanagan Date: Sun, 5 Apr 2026 13:37:03 -0400 Subject: [PATCH] fix: forward MCP_TIMEOUT, MCP_TOOL_TIMEOUT, MAX_MCP_OUTPUT_TOKENS to action step (#1162) These three env vars are read directly from process.env by the Claude CLI subprocess to configure MCP server behavior. Users setting them in their workflow had no reliable way to make them reach the CLI: - Job-level env: shadowed by the step's explicit env: block - Step-level env: on the calling workflow step is not inherited by composite action steps - GITHUB_ENV from a prior step: same shadowing problem - settings input: writes to ~/.claude/settings.json, not process.env The fix is to add explicit ${{ env.VAR }} passthrough lines for all three vars, matching the existing pattern already used for OTEL_*, AWS_*, and Vertex configuration (lines 271-317). No TypeScript changes are needed; the forwarding chain in parse-sdk-options.ts is already correct. Fixes #1152 Co-authored-by: Claude Sonnet 4.6 --- action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/action.yml b/action.yml index 28eca07..460a0a3 100644 --- a/action.yml +++ b/action.yml @@ -312,6 +312,15 @@ runs: ANTHROPIC_DEFAULT_HAIKU_MODEL: ${{ env.ANTHROPIC_DEFAULT_HAIKU_MODEL }} ANTHROPIC_DEFAULT_OPUS_MODEL: ${{ env.ANTHROPIC_DEFAULT_OPUS_MODEL }} + # MCP configuration — these env vars are read directly from process.env by the + # Claude CLI subprocess. They must be listed explicitly here because this step's + # env: block shadows the calling workflow's job-level env vars (GitHub Actions + # composite action behavior). Set these in your workflow's job-level env: or via + # a prior step that writes to $GITHUB_ENV. + MCP_TIMEOUT: ${{ env.MCP_TIMEOUT }} + MCP_TOOL_TIMEOUT: ${{ env.MCP_TOOL_TIMEOUT }} + MAX_MCP_OUTPUT_TOKENS: ${{ env.MAX_MCP_OUTPUT_TOKENS }} + # Telemetry configuration CLAUDE_CODE_ENABLE_TELEMETRY: ${{ env.CLAUDE_CODE_ENABLE_TELEMETRY }} OTEL_METRICS_EXPORTER: ${{ env.OTEL_METRICS_EXPORTER }}