Skip to content

fix: prevent UI proxy session load hangs#442

Merged
hsteude merged 4 commits into
mainfrom
fix/ui-proxy-session-load-hang
May 26, 2026
Merged

fix: prevent UI proxy session load hangs#442
hsteude merged 4 commits into
mainfrom
fix/ui-proxy-session-load-hang

Conversation

@hsteude

@hsteude hsteude commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • limit background global event SSE connections for inactive projects
  • strip hop-by-hop headers in the dev API proxy
  • abort upstream dev proxy fetches when client requests are aborted

Diagnosis

The OpenCode backend continued to answer /session directly, but the UI dev proxy hung on /session and /api/session. The UI server process had many established backend connections, consistent with accumulated background SSE proxy connections. Restarting the UI server clears those sockets, which explains the observed workaround.

Verification

  • bun run typecheck
  • bun test tests/sse.test.ts tests/events.test.ts tests/sync.test.ts
  • bun run build

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses UI dev proxy hangs by reducing background SSE pressure and improving proxy request handling for aborted clients and forwarded headers.

Changes:

  • Limits inactive-project global event SSE connections to a maximum of 16.
  • Removes selected forwarded request headers in the dev API proxy.
  • Propagates client abort signals to upstream dev proxy fetches.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app-prefixable/src/context/global-events.tsx Adds a cap on background global event connections for inactive projects.
app-prefixable/dev.ts Updates dev API proxy request forwarding headers and abort handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app-prefixable/dev.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread app-prefixable/src/context/global-events.tsx Outdated
Comment thread app-prefixable/dev.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread app-prefixable/src/context/global-events.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@hsteude hsteude merged commit db69357 into main May 26, 2026
1 check passed
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.

2 participants