Repository navigation
fix: classify Claude stream failures and safely recover thinking signatures - #263
Merged
Merged
Conversation
HTExplicit
enabled auto-merge (squash)
October 8, 2026 09:35
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.
Claude Messages stream errors were classified as 403 by default, so thinking-signature rejection, service failures and post-output overload appeared as access forbidden. Signature rectification also missed SSE errors and could not start after a slow initial HTTP response consumed the normal retry budget.
This change classifies the original stream error, records its actual carrying HTTP status separately, and permits one bounded same-account thinking repair before a message event is committed. It holds only message_start (64 KiB maximum), sends ping immediately, closes the rejected response before resending, and keeps attempts' message IDs, usage and model observations separate. Existing HTTP-only tool fallback, passthrough, Bedrock and other providers keep their contracts. Recovery evidence contains bounded signature fingerprints and explicit decisions, without new message or signature values. Ops detail shows stream semantics separately from actual HTTP; no database migration.
Validation: focused service/handler synthetic regressions passed, including slow-first-response budget, single-message recovery, output/size limits, actual retry failures, HTTP tool fallback and recovered stream interruption; protected existing stream and Ops terminal cases passed. Ops detail component: 16 tests passed. Changed frontend ESLint, Vue typecheck, YAML structure, static source checks and git diff checks passed. Independent review found no remaining blockers. No real model calls. Normal required PR checks remain enabled.