anthropics / anthropics/claude-code-action
Title: claude-sonnet-4-6 silent-fails with repeated empty turns (stop_reason: null, output_tokens: 8) — reproduces on v1.0.100 and v1.0.101
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.1k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
On claude-sonnet-4-6, claude-code-action reproducibly returns empty assistant turns in a tight loop (stop_reason: null, output_tokens: 8, rate ~2–3/sec). The action keeps retrying for ~20 minutes, then the workflow step exits as success with no artifacts produced — no commits, no branch, no result payload. The workflow cannot distinguish this failure mode from a normal completion.
Switching to claude-opus-4-7 on the same prompt, same tool scaffold, same repository state produces a clean run in ~12 minutes that commits and pushes the expected files. So the issue is Sonnet-specific (or at least Sonnet-sensitive), not a prompt or scaffold issue.
Pinning to v1.0.100 (claude-code 2.1.113 / Agent SDK 0.2.113) reproduces the same signature as v1.0.101 (claude-code 2.1.114), so the 2.1.114 internal bump is not the cause.
Reproduction
Versions tested (identical signature on both):
anthropics/claude-code-action@v1.0.101(currently@v1)anthropics/claude-code-action@0d2971c794049856e777f4e8bb5a81623ec632d3(v1.0.100, pinned manually)
Model: claude-sonnet-4-6
Invocation: claude-code-action in a GitHub Actions workflow, triggered by @developer in an issue comment. Prompt is a ~60-line agent brief instructing Claude to read a skill file, load a linked implementation plan, and execute it (code edits, test updates, commit, push). claude_args includes --model claude-sonnet-4-6 --allowedTools "Bash(...),Read,Write,Edit,Edit(**),Write(**)".
Three runs, same signature, repo <your-repo>:
Run ID | Version | Outcome
-- | -- | --
24679711304 | v1.0.101 / 2.1.114 | silent-fail
24681760292 | v1.0.101 / 2.1.114 | silent-fail
24685076712 | v1.0.100 / 2.1.113 | silent-fail, same signature
Log signature (excerpt from run 24685076712, developer job):
2026-04-20T19:07:08.8289Z "stop_reason": null,
2026-04-20T19:07:08.8293Z "output_tokens": 8,
2026-04-20T19:07:09.2510Z "stop_reason": null,
2026-04-20T19:07:09.2513Z "output_tokens": 8,
2026-04-20T19:07:09.7397Z "stop_reason": null,
2026-04-20T19:07:09.7414Z "output_tokens": 8,
... (continues for ~20 min at ~2–3 empty turns/sec)
Control run (same workflow, same issue, claude-opus-4-7): developer-rescue job in the same run (24685076712) — completed successfully in 12 minutes, pushed 2 commits (e937bc9a, 74314772) to a feature branch, posted the expected follow-up comment on the issue.
Impact
- Step
conclusionissuccessin the GitHub Actions API despite no artifacts produced — downstream steps and assertions (ACC-style contracts) cannot distinguish "completed cleanly" from "returned empty". - The ~20-minute empty-retry loop consumes API quota with no user value.
- In our setup, this is routinely burning the Claude Max weekly budget on runs that produce nothing.
What would help
- Emit a distinguishable exit status (or populate
resultwith an error marker) whenoutput_tokens <= Nandstop_reason: nullpersists across >K turns. Today the action succeeds loudly with nothing to show. - Surface the underlying model response to the workflow log at a higher level than the raw stream so users can see the empty-turn pattern without grepping raw JSON.
Contributor guide
Research direction
Start at the claude-code-action invocation in the GitHub Actions workflow and trace how claude_args, empty turns, stop_reason, and output_tokens are handled in the developer job. Reproduce the three listed runs with claude-sonnet-4-6, then compare the behavior with claude-opus-4-7; done means repeated empty turns cannot exit successfully without artifacts and the workflow reports the failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ai-infra-agents, ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100