Fix quick chat blank response when Claude hits max-turns limit#82
Merged
mcintyre94 merged 1 commit intomainfrom Mar 15, 2026
Merged
Fix quick chat blank response when Claude hits max-turns limit#82mcintyre94 merged 1 commit intomainfrom
mcintyre94 merged 1 commit intomainfrom
Conversation
When --max-turns is reached mid-tool-use, the result event has subtype "error_max_turns" with is_error:false, causing the app to silently show a blank response. Now checks the subtype field and surfaces a user-friendly error message. Also bumps --max-turns from 3 to 5 so Claude has room for up to 4 read-only tool calls (Glob/Grep/Read) before responding, reducing how often the limit is hit in practice. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--max-turnsis hit mid-tool-use, Claude emits a result event withsubtype: "error_max_turns"andis_error: false— the old code only checkedisError, so the user silently got a blank response with no error shownsubtypeand surfaces a specific message: "Claude hit the turn limit without responding — try a simpler question"--max-turnsfrom 3 to 5 so Claude has headroom for up to 4 read-only tool calls (Glob/Grep/Read) before responding — with 3, any question needing two reads before answering would hit the wallTest plan
error_max_turnswith empty response (shows specific error) and non-empty response (no error, preserves partial answer)isError: trueand successful results still pass🤖 Generated with Claude Code