streamcause: the stream give-up line blamed the server for our own session - #208
Merged
Conversation
… session A consolidation pass over this session's own commits found two things in streamLoop, both introduced by earlier ones in the same run. The give-up line is the only thing an operator gets for "why does tools/list_changed never arrive", and there are two answers. A server that does not offer the stream is a fact about the server. A session this client lost is a fact about this client — the same server would serve the stream again to a connection that had one. Since the gateway started opening the stream, the second case is reachable and was reported as the first, sending the reader to the wrong system. The doc comment still named the six statuses streamRefusedPermanently replaced, contradicting the code twenty lines below it. Recorded rather than fixed, in that comment: the loop has no session-recovery path at all. A reopen after the peer expires a session carries a stale id (404) or none (400), both permanent refusals, so the stream stays down for the transport's life although the server does offer it — until the next real tools/call respawns the connection, which for an idle hosted downstream can be a long time. The obvious fix reintroduces exactly the unbounded five-second heartbeat streamRefusedPermanently was written to remove, unless a retry budget or a signal from the POST path bounds it. That is a policy decision, not something to settle an hour before a release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Round 23: a consolidation pass over the ten commits this session landed, looking for an interaction
none of them has alone. Six checked, four clean; the two that were not are both in
streamLoop.