Repository navigation
fix(core): count websocket stream failures - #50955
rekram1-node wants to merge 1 commit into
Conversation
|
I checked the failure-accounting cases on head c0fd5c4 more closely. The regressions pin three different outcomes:
That distinction looks important. The breaker is counting actual failed exchanges, not simply every non-terminal stream exit, and interruption does not poison the transport. The existing reader-loss coverage also continues to protect against double-counting. Exact-head check and test workflows are green. I did not run this against a live provider WebSocket, but the state-machine boundary itself looks directly exercised here. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Related to #50213
Type of change
What does this PR do?
WebSocket stream finalization cleared the active exchange before poisoning the connection, so idle timeouts and response parser failures never incremented the five-loss HTTP fallback breaker.
Use exit-aware finalization and pass the failure decision explicitly to connection poisoning. Genuine stream failures now count once, while user interruption and clean terminal responses do not count. After five consecutive failures, the Session stays on HTTP as intended.
How did you verify your code works?
bun test test/session-model-transport.test.tsfrompackages/corebun run checkfrom the repository rootAdded regressions for repeated idle timeouts, repeated parser failures, interruption exclusion, and the existing reader-loss test continues to guard against double counting.
Screenshots / recordings
Not applicable.
Checklist