anthropics / anthropics/claude-code-action
No error message displayed when Claude runs out of turns
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.1k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
**Describe the bug**
When the action hits the maximum number of turns configured by the `--max-turns` flag, the action exits with status code 1, but does not supply an associated error message. The result message contains the subtype `error_max_turns`, but the `errors` property is empty. This property is used [construct the final error message](https://github.com/anthropics/claude-code-action/blob/b6e5a9f27ac3c7d2c2b1542b8670917750e0433f/base-action/src/run-claude-sdk.ts#L215), but as it's empty nothing is displayed (see screenshots below).
**To Reproduce**
Surfacing this error is probably a little non-deterministic. The best way I can think of to reproduce it would be to test a workflow with a small number of turns.
**Expected behavior**
The error message should probably state the error subtype if the errors property is empty.
**Screenshots**
Partial screenshots below showing some information from the result message and the resulting error message upon action exit.
**API Provider**
[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex
**Additional context**
I've only tested this with SDK mode. Not sure if this applies to Claude CLI mode.
Contributor guide
Assessment
This issue has not been assessed yet.