fix(app): defer background workspace discovery - #47428
Open
opencode-agent[bot] wants to merge 3 commits into
Open
fix(app): defer background workspace discovery#47428opencode-agent[bot] wants to merge 3 commits into
opencode-agent[bot] wants to merge 3 commits into
Conversation
opencode-agent
Bot
requested review from
Brendonovich and
Hona
as code owners
September 5, 2026 02:24
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
Stop the app from eagerly discovering worktrees and MCP catalogs for historical projects that nobody has opened.
The existing APIs are reused. All changes are confined to
packages/app; no Core, Server, Protocol, or Client-package changes, new endpoints, or user-data migrations.Why
Global bootstrap previously issued a worktree-list request for every historical project at once. Each request can initialize a Location and run discovery. Separately, MCP events caused catalog reads for unopened locations. Both paths can occupy the browser's connection pool, leaving health probes and interactive requests queued while an existing event stream continues receiving data.
Validation
bun run test:unit: 752 passed, 1 skipped, 0 failed.bun run test:browser: 117 passed, 0 failed.bun typecheck: passed.bun run typecheck:e2e: passed.bun --bun run build: passed (the Host's default Node 18 cannot run this Vite version; the build succeeds under Bun).f41e968: 55 passed, zero retries across deferred discovery, workspace accents, MCP toggles, settings loading, branch selection, and pending/failed workspace creation. 300 historical projects produce zero new-draft startup inventory calls; opening the picker loads exactly one project; an existing session loads only its own project and stays editable while that inventory is deliberately stalled.f41e968: typecheck, Linux/Windows unit tests, and Linux/Windows E2E (including service-worker verification). Test run: https://github.com/anomalyco/opencode/actions/runs/33940334857e06f774→ca7ff99), three repetitions per scenario: median stable readiness was 229 → 246 ms for Home-to-draft, 270 → 131 ms for session-to-draft, and 785 → 717 ms for cold session entry. The baseline had one initial-navigation timeout before measurement (8/9 passed); the after run passed 9/9. These small, sequential shared-host samples do not establish statistically significant improvements or rule out smaller regressions.Requested by: @Hona (Hona via Slack)