Skip to content

fix: suppress recoverable global event stream noise - #715

Merged
Astro-Han merged 5 commits into
devfrom
codex/fix-i690-sse-console-noise
May 18, 2026
Merged

fix: suppress recoverable global event stream noise#715
Astro-Han merged 5 commits into
devfrom
codex/fix-i690-sse-console-noise

Conversation

@Astro-Han

Copy link
Copy Markdown
Owner

Summary

Suppress recoverable global event stream disconnects from the install-build console error path.

Why

The packaged app can show /global/event failures such as net::ERR_NETWORK_IO_SUSPENDED, followed by [global-sdk] event stream error, even when the app and local sidecar keep running normally. That stream is the global SSE subscription used for app state updates, and these Chromium/Electron disconnects are recoverable through the existing reconnect loop.

The bug is that recoverable SSE disconnects were logged like product failures.

Related Issue

Closes #690

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

Please check the classifier boundary: intentional aborts and known Chromium/Electron recoverable network disconnects should stay out of console.error, while unknown parse/server errors still report.

Risk Notes

Low. The PR does not change the SSE reconnect loop, cursor replay, heartbeat, server route, or event reducer behavior. It only changes whether known recoverable disconnects are treated as console errors in the global SDK stream path.

How To Verify

Focused SSE tests: 17 passed with bun test --preload ./happydom.ts src/context/global-sdk/sse-error.test.ts src/context/global-sdk/sse-cursor.test.ts src/context/global-sdk-event-queue.test.ts
App typecheck: ok with bun --cwd packages/app typecheck
Lint: ok with bun run lint
App unit suite: 1168 passed with bun --cwd packages/app test:unit
Root typecheck: 8 tasks successful with bun turbo typecheck
Desktop build: ok with bun --cwd packages/desktop-electron build
Desktop smoke: ok with bun --cwd packages/desktop-electron smoke:ci
Diff check: no whitespace errors with git diff --check

Screenshots or Recordings

Not applicable. This is a console logging / SSE error classification change with no visible UI changes.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has exactly one type label (bug, enhancement, task, or documentation), at least one primary routing label (app, ui, platform, harness, or ci), and exactly one priority label (P0 to P3), or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

@Astro-Han Astro-Han added bug Something isn't working P3 Low priority app Application behavior and product flows labels May 18, 2026
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 10 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 45fdb767-3106-4a63-b607-8e872a79c282

📥 Commits

Reviewing files that changed from the base of the PR and between e8ba3a9 and ee3407b.

📒 Files selected for processing (5)
  • packages/app/src/context/global-sdk.tsx
  • packages/app/src/context/global-sdk/sse-error.test.ts
  • packages/app/src/context/global-sdk/sse-error.ts
  • packages/opencode/test/github/codeql-workflow.test.ts
  • packages/opencode/test/github/pr-routing-triage.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-i690-sse-console-noise

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the ui Design system and user interface label May 18, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested priority: P2 (includes user-path files (packages/app/src/context/global-sdk.tsx, packages/app/src/context/global-sdk/sse-error.test.ts, packages/app/src/context/global-sdk/sse-error.ts)).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@Astro-Han Astro-Han removed the ui Design system and user interface label May 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors SSE error handling by replacing a Zod-based abort check with a more comprehensive isRecoverableSseDisconnect utility. This new utility identifies recoverable network errors, such as Chromium's suspended IO or closed connections, alongside intentional aborts. Unit tests were also introduced to verify these scenarios. The reviewer suggested improving the robustness of the error detection by using an isErrorLike type guard instead of strictly checking for TypeError, which would ensure better compatibility across different environments.

Comment thread packages/app/src/context/global-sdk/sse-error.ts Outdated
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown

Perf delta summary

Comparator: pass

Profile / Scenario interaction median interaction worst long task max tbt frame gap p95 frame gap max jank count cls status
default / homepage-cold 40 -> 48 (+8) 48 -> 48 (0) 107 -> 77 (-30) 57 -> 27 (-30) 33.3 -> 33.4 (+0.1) 183.3 -> 116.7 (-66.6) 4 -> 4 (0) 0 -> 0 (0) pass
default / long-session-input-lag 40 -> 48 (+8) 64 -> 48 (-16) 0 -> 0 (0) 0 -> 0 (0) 16.7 -> 16.8 (+0.1) 16.7 -> 16.8 (+0.1) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-streaming-long 48 -> 48 (0) 80 -> 64 (-16) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.7 (-0.1) 33.3 -> 33.3 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-call-expand 16 -> 16 (0) 16 -> 24 (+8) 0 -> 0 (0) 0 -> 0 (0) 16.7 -> 16.7 (0) 16.7 -> 16.7 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-default-open-heavy-bash 24 -> 32 (+8) 32 -> 40 (+8) 69 -> 65 (-4) 19 -> 15 (-4) 49.9 -> 50 (+0.1) 166.7 -> 100 (-66.7) 3 -> 3 (0) 0 -> 0 (0) pass
default / terminal-side-panel-open 56 -> 48 (-8) 56 -> 56 (0) 0 -> 0 (0) 0 -> 0 (0) 33.4 -> 33.4 (0) 33.4 -> 33.4 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-scroll-reading 24 -> 24 (0) 32 -> 32 (0) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.7 (-0.1) 16.8 -> 16.7 (-0.1) 0 -> 0 (0) 0.505 -> 0.505 (0) warn: cls

@github-actions github-actions Bot added the ui Design system and user interface label May 18, 2026
@github-actions github-actions Bot added the harness Model harness, prompts, tool descriptions, and session mechanics label May 18, 2026
@Astro-Han
Astro-Han merged commit 3823010 into dev May 18, 2026
28 checks passed
@Astro-Han
Astro-Han deleted the codex/fix-i690-sse-console-noise branch May 18, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working harness Model harness, prompts, tool descriptions, and session mechanics P3 Low priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Global SSE suspension logs recoverable /global/event disconnect as console error

1 participant