fix(coding-agent): never block opening the visible agents-view row on a pending selection anchor - #2079
Closed
snimu wants to merge 1 commit into
Closed
fix(coding-agent): never block opening the visible agents-view row on a pending selection anchor#2079snimu wants to merge 1 commit into
snimu wants to merge 1 commit into
Conversation
… a pending selection anchor Restoring the remembered selection could gate every open behind 'Waiting for the selected session to load' until the saved catalog settled. User intent now supersedes anchor restoration: Enter opens the row under the cursor (openSelected is synchronous from keypress to finish, so there is no reshuffle window), searching claims the visible row as the new anchor, and a scoped view no longer seeds its own excluded root as the anchor — the case that armed the wait on every subagents-view entry. Untouched sessions still re-anchor to the remembered row once its catalog row arrives. Fixes RES-1314.
sethkarten
added a commit
that referenced
this pull request
Sep 7, 2026
Contributor
sethkarten
added a commit
that referenced
this pull request
Sep 7, 2026
…2068) * feat(coding-agent): show the model label on every agents-view row Resident summaries carry model info for all session kinds; only the renderer restricted the label to subagent rows. Drop the special case so any row whose summary has a model renders provider/id[:thinkingLevel] in the suffix region, still suppressed while pending delete/kill. * fix(coding-agent): open visible sessions without waiting for selection anchors Consolidates #2079 at d5b4926. * feat(tui): open local file links Consolidates #2073 at b6e83f0. * feat(coding-agent): highlight file references and command options Consolidates #1145 at 285ccf4. * feat: refresh Prime Inference models from the live catalog Consolidates #1928 at 24d3413. * feat(coding-agent): let root agents create sibling sessions Consolidates #1996 at 0c9c883. * feat(coding-agent): wake agents when asynchronous bash finishes Consolidates #2053 at 1bb4d43. * feat(coding-agent): simplify the agents view while retaining model details Consolidates #2087 at dc67428. Retains #2068 model visibility and #2079 immediate opening and query ownership. * fix(coding-agent): preserve background work and sibling-session credentials Keep managed shell commands active until completion delivery is accepted. Forward only effective same-provider transient auth when creating root sessions. Integration fixes for #2053 and #1996. * fix(coding-agent): address session lifecycle and rendering regressions Preserve sibling PATH and reject root creation after disposal. Treat background completions as new runs without duplicate as_completed wakes. Keep table delimiters visible and sanitize live catalog display metadata. Scope the stale-auth regression fixture to its cached Prime team. * fix(coding-agent): forward the selected provider environment credentials Preserve alias priority and runtime credential identity when creating sibling sessions. Pin that a create timeout never dispatches the task prompt. * fix(runtime): recheck creating-cell waits when shell commands settle Preserve late as_completed consumers without suppressing detached completion notices. Document the cached-wrapper result limitation. * fix(runtime): preserve background bash completion lifecycle Wait for process-group cleanup before releasing residency. Defer paused admission within the original request and report terminal rejection. Preserve notices after cancelled non-owning waits and clean up interrupted task construction. * fix(runtime): use a portable signal for construction cleanup Keep immediate POSIX cleanup and use the existing Windows job cleanup path without referencing SIGKILL. * fix(coding-agent): steer shell messages and stop losing supervisor launches Deliver labeled shell completion messages at the next safe turn boundary. Stop only an owned replacement child that loses to a current authenticated supervisor. --------- Co-authored-by: Seth <seth@primeintellect.ai>
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.
Fixes RES-1314
Purpose
Opening a row in the agents view could be blocked for 5-10s+ with "Waiting for the selected session to load" — very frequently in a subagents (scoped) view, almost never in the main view. User intent now supersedes selection-anchor restoration: what you see is what Enter opens.
Root cause and asymmetry
restoreSelection()armsselectionAnchorPendingwhenever the remembered anchor (selectedRowIdentity/selectedSessionKey, incl. persisted state) cannot resolve against the current rows, andopenSelected()blocked EVERY open while pending; the flag only cleared inresolveMissingSelectionAnchor()after the saved-catalog refresh settled.Why the subagents view, specifically:
Changes (blocking semantics only; saved-catalog latency is #2043/#2051's scope)
openSelected(): the pending gate and its status message are deleted. The handler is synchronous from keypress tofinish()and acts on the row captured at entry (this.rows[this.selectedIndex]), so there is no window in which rows can reshuffle under the open; the "temporary fallback" row is a real rendered summary and opening it opens exactly that session. No residual case needs the message.queryChanged(): searching now claims the visible row as the new anchor (unconditionalsyncSelectedRowState), instead of preserving a stale anchor that could later yank the selection mid-search. Arrow-key navigation already claimed the row (moveSelection→syncSelectedRowState), which clears the pending flag — traced, unchanged.createInitialAgentsViewPersistentState(): a scoped entry no longer seeds the scope root as the selection anchor (it keepsbackSessionfor Escape). This removes the guaranteed-unresolvable anchor from every subagents-view entry.restoreSelectionkeeps trying the remembered anchor on each catalog update and still lands on it when its row streams in;resolveMissingSelectionAnchorstill adopts the fallback only after the saved catalog settles.Tests (one pin per behavior, each proven fail-unfixed against the old code)
queryChangedclaims the selection while the anchor is pending (extends the existing query test).backSessionretained.LOC
Total src: +13/-12 (net +1); tests: +18/-1; changelog fragment +1.
Validation
npm run checkgreen (pre-commit hook); rebased onto v0.9.3 main (915c78f).Note
Low Risk
Small UX/selection-restore behavior change in agents view only; no auth, data, or security paths touched.
Overview
Fixes agents view Enter being blocked for seconds with "Waiting for the selected session to load" while a remembered selection was still resolving against the saved catalog—especially when opening a scoped (subagents) view.
Opening:
openSelected()no longer gates onselectionAnchorPending; it always acts on the row under the cursor.Scoped entry:
createInitialAgentsViewPersistentState()stops seeding the scope root as the selection anchor (that row is excluded from its own children list, so the anchor could never resolve).backSessionfor Escape/back navigation is unchanged.Search:
queryChanged()always runssyncSelectedRowState()so typing a query adopts the visible row instead of holding a stale anchor.Passive restore still re-anchors when the remembered row appears after catalog load; tests cover open-while-pending, search-while-pending, and scoped vs unscoped seeding.
Reviewed by Cursor Bugbot for commit d5b4926. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
AgentsViewMode.openSelectedto not block on pending selection anchorAgentsViewMode.openSelectedthat showed a waiting status and returned early when a remembered selection anchor was still pending; selectable rows now open immediatelyAgentsViewMode.queryChangedalways sync selection to visible rows after a query change, instead of skipping sync while an anchor is pendingcreateInitialAgentsViewPersistentStateso scoped agents-view initialization no longer seeds the entered-from session as a selected-row anchor; the session remains available asbackSessionfor scope navigationMacroscope summarized d5b4926.