Skip to content

streamcause: the stream give-up line blamed the server for our own session - #208

Merged
dinstein merged 1 commit into
mainfrom
streamcause
Aug 6, 2026
Merged

streamcause: the stream give-up line blamed the server for our own session#208
dinstein merged 1 commit into
mainfrom
streamcause

Conversation

@dinstein

@dinstein dinstein commented Aug 6, 2026

Copy link
Copy Markdown
Owner

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.

  • 1. The give-up line names which of the two causes ended the stream, and the doc comment matches the code again

… 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>
@dinstein
dinstein marked this pull request as ready for review August 6, 2026 05:57
@dinstein
dinstein merged commit 3f72ea6 into main Aug 6, 2026
3 checks passed
@dinstein
dinstein deleted the streamcause branch August 6, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant