Repository navigation
fix(desktop): prevent not-found panel while new worktree is creating - #2293
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Register pending starts in queue.starts before open_now runs, skip page/session reads and 404 not-found transitions while a start is still in flight, retain pending starts across memory reclamation, and allow server-confirmed promotion or landed pages to recover Resolution::NotFound to Ready. Fixes #2276
Hona
force-pushed
the
fix/new-worktree-not-found
branch
from
December 3, 2026 12:20
0dcf86a to
87be6a7
Compare
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
Fixes #2276.
When starting a session in a new worktree whose setup takes longer than a moment, speculative or reconnect reads could hit
GET /api/session/<id>/messagebefore the worktree finished and the session existed on the server, turning the pending tab into the sticky "This session cannot be found" panel.Changes
apps/desktop/src/workspace/lifecycle/new_session/mod.rs): Splitshow_startintoprepare_start+open_nowsostartand bothbegin_startpaths insert intoqueue.startsbefore callingopen_now, lettingopen_now's pending-start guard skip premature/inbox,/permission,/form,/children, and/jobsreads. Complete those live-open reads andwindow_openedinpromote_startonce the server proves the session exists.apps/desktop/src/session/pages/mod.rs,apps/desktop/src/session/pages/shown.rs,apps/desktop/src/session/meta/open.rs): Guardprefetch_page,reload_session,open_page,read_shown_session,resync_view, andApp::open'sheldcheck againstqueue.starts.has(id)so tab/sidebar hover, switching away and back, and SSE reconnects keep showing the pending creating state cleanly without firing 404s.NotFoundand allow recovery (apps/desktop/src/session/pages/mod.rs,apps/desktop/src/session/meta/state.rs): Ignore 404 page errors inpoll_pagesandsession_state::missingwhilequeue.starts.has(id)(leaving genuine 404 and deleted sessions unchanged). Allow explicit server proof (session_state::known, called frompromote_startand landed pages, never fromsession_state::poll) to moveResolution::NotFoundback toResolution::Ready.apps/desktop/src/shell/memory_reclaim.rs): Retain sessions inqueue.startsduring tab-close and periodic sweeps so long worktree setups do not lose their local prompt transcript.Verification
pwsh scripts/guardrails.ps1(11/11 passed),cargo check -j 1 -p opencode-desktop, andcargo clippy -j 1 -p opencode-desktop --no-deps(zero warnings in touched files).