Repository navigation
refactor(sse): classify SSE critical-path empty catches + add CONTRIBUTING convention (#8142) - #8364
Merged
Conversation
…UTING convention (#8142)
HouMinXi
pushed a commit
to HouMinXi/OmniRoute
that referenced
this pull request
Aug 2, 2026
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
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.
Summary
catch {}blocks in the SSE critical path (open-sse/utils/stream.tsx6,open-sse/utils/streamHandler.tsx1) into two buckets: intentional (our own best-effort cleanup/telemetry — gets a one-line rationale comment, no logging) vs should-log (the caller-suppliedonFailurecallback — a throw there previously vanished silently, changing control flow with zero trace).open-sse/executors/cursor.tsis already at zero from fix(stream): add logging to empty catch blocks in stream error handling #8143 and untouched here.Sites classified
stream.tsL816consumeToolFinishTime— intentional (comment)stream.tsL1833, L2112 — telemetry/latency recording — intentional (comment)stream.tsL1870, L1998markToolFinish— intentional (comment)stream.tsL1946onFailure(failurePayload)— should log: kept the catch (never break the stream) but addedconsole.debugso a buggy consumer callback is now discoverablestreamHandler.tsL586controller.close()after disconnect — intentional (comment; the canonical example the issue cites)How tested
TDD per Hard Rule #18 — new test file
tests/unit/stream-onfailure-callback-logging.test.ts:console.debugcall referencingonFailureis emitted when the caller-supplied callback throws. Failed before the change (empty catch swallowed silently, no log).console.debug), test now passes.onFailurereturning normally emits no log and behaves byte-identically — proves the happy path and the 6 comment-only sites are behavior-free.Also verified:
tests/unit/stream-utils.test.ts+tests/unit/claude-empty-stream-error-3685.test.tsstill 58/58 green (no regression in adjacent stream-path coverage).Gates run locally: typecheck:core clean, eslint clean on changed files, check:cycles clean, check-file-size.mjs clean (tightened an unrelated 3-line JSDoc block to 1 line to stay under the frozen
stream.tsbaseline after adding the log), check-test-discovery.mjs clean.check:complexity-ratchetsshows the same pre-existing base-red as the pristine tip (2167/956 vs baseline 2130/951) — unaffected by this change.Closes #8142