Repository navigation
Conversation
…, since collapsed calls print no ⎿ (THI-455) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…pi_error, no prompt needed (THI-455) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ince, not that the last tool result failed (THI-455) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tdody
deleted the
thibaultdody/thi-455-api-error-flag-sticks-after-the-session-recovers-when-tool
branch
November 3, 2026 14:54
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.
The critter's "the Anthropic API is erroring in 1 pane" item and the pane header's "⚠ API error" stayed on for a pane whose stream cut had recovered half an hour earlier. Two later prompts had both got complete replies.
Cause
_detect_api_errorreads the pane upward from the bottom. It returns true at the firstAPI Error:line, and only a⎿tool-result line stops it first. Claude Code collapses successful tool calls intoCalled <server> N times (ctrl+o to expand), which prints no⎿. In a pane with only collapsed calls, prose and prompts since the error, nothing stopped the scan before the old error, so the flag stayed on until the line scrolled out of the 100-line capture.Fix
Anything Claude wrote below the error means the API answered, so the scan also stops at a
⏺line or a collapsed tool group (COLLAPSED_TOOL_GROUP_RE: an indented row starting with a capitalized verb and ending in(ctrl+o to expand), e.g.Called fdy 6 times,Read 1 file,Made 3 edits). No later prompt is needed, so it also clears when Claude Code carries on by itself after a stream cut, the common case: about 40 of 67 mid-response errors in local transcripts recovered that way. A result's… +N linesrow and› Message from @…agent rows don't match, so they can't clear an error they belong to.The header chip's tooltip now says "Claude hit an API error and has written nothing since" instead of "last tool result was an API error".
Tests
collapsed-calls-later-reply(the live pane, abridged) andstream-cut-recovered-in-turn(the same pane when its first turn ended): both flagged before, clear now.rate-limited-resuming-calls: a nudged turn that has only printedCalled fdy 6 timesso far is clear.rate-limited-stuckis nowrate-limited-resumedand expects the flag off: Claude has replied after the lastkeep going.error-then-only-textnow expects the flag off: its fixture has a⏺reply and a finished turn after the error, which the old expectation only guessed was still stuck.rate-limited-nudged(keep goingwith only a spinner below it) and newerror-truncated-result(an error whose… +3 lines (ctrl+o to expand)row sits under it).bin/checkis clean, pytest passes (2080), vitest passes (1313). Against every live pane, the only one whose flag changes is the incident pane, which now reads clear.Assumptions
⏺line and collapsed tool group below an error was written after it by Claude. The agent panel's⏺rows under the composer are cut off before the scan.… +N lines,… N more lines) and agent-message (› Message from @…) rows don't, per a survey of the(ctrl+o to expand)rows in all live panes.Linear: THI-455
🤖 Generated with Claude Code