Repository navigation
fix(app): dispose server roots when the app unmounts - #33
Merged
Merged
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above before requesting review. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
stroopc-owner
marked this pull request as ready for review
October 8, 2026 20:16
stroopc-owner
self-requested a review
October 8, 2026 20:17
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
GlobalProvidercreates one detachedcreateRootper server and only disposed it when the server left the list. Unmounting the app left every root alive, so each server's event stream stayed open and kept reconnecting.Forge remounts the embedded app on every task switch. Each switch leaked one
/api/eventstream. Once the leaked streams fill the browser's per-origin limit (6 over HTTP/1.1, 100 streams on Forge's HTTP/2 origin), new requests queue indefinitely. The agent, provider, and model syncs never complete, the composer hides the model picker, and sending shows "Select an agent and model".GlobalProvidernow disposes every server root on cleanup.Verification
Mounted the embedded app against two local OpenCode servers and switched between them repeatedly.
/api/eventstreams grew by one per switch. The pane stopped loading after 4 switches over HTTP/1.1, and after 10 behind an HTTP/2 proxy limited to 12 streams.