Skip to content

feat(dashboard): open the agent's workspace when a card is clicked - #7

Merged
nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/Agent-Dash-go-to-workspace
Sep 19, 2026
Merged

nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/Agent-Dash-go-to-workspace

Conversation

@nplez1

@nplez1 nplez1 commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​142 $\color{#cf222e}{\Huge{\mathbf{−}}}$​30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​112
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​186 $\color{#cf222e}{\Huge{\mathbf{−}}}$​28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​158

ELI5

The Agent Dashboard shows one card per running agent. Clicking a card used to open a live preview of that agent's terminal, and you had to click again ("Open worktree") to actually reach it. Now the click takes you straight to the agent's workspace, and a new setting puts the preview back for anyone who prefers it.

What Changed

Before: clicking a card on the Agent Dashboard opened the live terminal preview dialog. Reaching the agent took a second click on that dialog's Open worktree button.

After: clicking a card jumps to that agent's workspace and focuses its pane — in-window the companion board closes behind you, and in the pop-out the main window is raised and routed to the pane. A new Clicking a card setting (board settings gear, or Settings → Experimental → Agent Dashboard) chooses Open workspace (default) or Preview, the latter restoring today's behavior including the dialog's own Open worktree button.

Mechanism: the choice rides the dashboard snapshot (cardClickAction, built next to showIdle and validated in the main process on snapshot admission), so the in-window board and the pop-out window read one value instead of each host threading a new prop. The card click handler acks the agent (unchanged seen-state semantics) and then either calls the same reveal dispatcher the preview dialog's button already used, or opens the dialog. The card prop onOpenTerminal became onActivateCard because it no longer always opens a terminal, and reveal routing is now built by one shared dashboardCardRevealArgs(card) helper.

Why

The dashboard exists to get you to an agent that needs you, so making its primary click land on a preview rather than the agent added a click to the main path. Defaulting to the workspace matches what clicking an agent does everywhere else in Orca, and the preview is still one setting away for people who want to read before they jump.

Alternatives considered: passing a cardClickAction prop from each host (two host changes and two call sites to keep in sync, versus one snapshot field the board already consumes), and reading the setting from the store inside AgentKanbanBoard (breaks the board's "pure projection of its snapshot" contract and adds a Zustand subscription to a surface that republishes up to 4×/s).

Linked Issue

N/A — no tracked issue; this is an interaction change requested directly.

Visual Proof

N/A — interaction change (where a card click lands) plus one new settings row, with no new layout or visual structure. Behavior is covered by the added board-routing tests and the Agent Dashboard e2e; no screenshots per request.

Testing

  • pnpm tc — typecheck clean.

  • pnpm test src/renderer/src/components/dashboard-popout/ src/renderer/src/components/dashboard/ src/main/ipc/dashboard-payload-validation.test.ts — 380 pass, including new cases for the default workspace routing (correct reveal args, no dialog), the preview option, the snapshot field, and its IPC validation.

  • pnpm run check:code-quality:changed — 0 findings.

  • Localization catalog / runtime-catalog / extraction / coverage verifiers — clean.

  • Rendered check on the built app: npx playwright test tests/e2e/agent-dashboard-sidebar-toggle.spec.ts --project=electron-headless (background launch, CDP, no focus steal) — passes.

  • Not run locally: full pnpm test, full pnpm lint. macOS only; no Windows / Linux / SSH run.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Written with the pi coding agent under human direction and review.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: no new IPC channel; the existing reveal path and its validation are untouched. The new snapshot field is validated on admission exactly like showIdle.
  • Cross-platform: no platform-specific behavior; the change is presentation and routing only.
  • SSH / remote and folder workspaces: reveal goes through the existing dispatcher, which already handles non-local execution hosts and non-git folder workspaces.
  • Backwards compatibility: the setting is optional, and absent means the new workspace default. A pop-out running pre-upgrade code ignores the extra snapshot field.
  • Performance: no new subscription on the board's hot path; the field is computed in the snapshot builder that already reads settings, and invalid values reject the frame the same way a bad showIdle does.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass — typecheck, targeted tests, changed-code gate, and the e2e build pass locally; full lint/test/build left to CI.

Clicking an agent card on the Agent Dashboard opened the live terminal preview, so
reaching the agent you had just spotted took a second click on the dialog's "Open
worktree" button. The card goes straight there now, and the preview is the option.

- Routes the click through the board: ack the agent, then reveal its workspace and
  focus its pane with the same dispatcher the dialog's "Open worktree" button already
  used, unless the new experimentalAgentDashboardCardClickAction setting says preview.
- Carries the choice on the dashboard snapshot next to showIdle, so the in-window board
  and the pop-out window read one value instead of threading another host prop; the
  main-process snapshot admission validates it alongside showIdle.
- Surfaces the setting on both existing Agent Dashboard settings surfaces: the board's
  gear menu and Settings -> Experimental -> Agent Dashboard.
- Extracts dashboardCardRevealArgs(card) so the board and the preview dialog build the
  reveal routing in one place, and renames the card's onOpenTerminal prop to
  onActivateCard, which no longer names what the callback always does.
@nplez1
nplez1 merged commit cbe6a74 into nplez1/main Sep 19, 2026
28 of 31 checks passed
nplez1 added a commit that referenced this pull request Oct 17, 2026
…link

Review of the previous commit found two ways the repo choice could mislead.

`linkedIssue` and `linkedWorkItem` are separate slots and `linkedIssue` wins
(workspace-linked-issue.ts), so the number the pane renders can name an issue
while the work item is something else: a PR, a Linear task, or a different
number. The previous commit borrowed that item's repo unconditionally, so a
workspace created from PR #12 and later linked to issue #7 would have read #7
out of #12's repo. The repo is now borrowed only when the item is a GitHub
issue with the rendered number; anything else reads the workspace repo, which
is what it did before.

The silent fallback when the item's repo is not registered on this device is
gone. It restored the old read, resolving the same number in whatever project
the workspace repo happens to be — showing an unrelated issue is worse than the
unavailable state, and the failing RPC was a wasted round trip either way.

Tests: a PR, a different number and a Linear task each keep the workspace repo,
and an unregistered item repo renders unavailable without calling the lookup.

Left out of scope, noted on the PR: the workspace card still fetches
`linkedIssue` from the workspace repo (use-worktree-card-lifecycle-effects.ts),
so for these workspaces the pane loads while the card's decoration does not.
nplez1 added a commit that referenced this pull request Oct 17, 2026
…om (#126)

* fix(issue-pane): read the linked issue from the repo the item came from

A workspace created from a task on another host (or in another project) lives
in that project's repo there, while the issue stays in the repo the task was
listed from. The pane read the issue out of the workspace's repo and sent the
task source's repo id with it, so a paired client asked the workspace's host
for a repo id only the client knows: the host answered "repo_not_found" and the
pane showed "Couldn't load this GitHub issue" over a link that was intact.

Resolve the repo through the linked item first and fall back to the workspace's
repo when that row is not registered on this device. Folder workspaces already
resolved this way; every other workspace now shares the rule, so the repo path,
the repo id and the routing target all describe one repo.

Considered sending the workspace row's repo id to the host instead. That works
only while both machines hold the same repo: when they do not, the issue number
resolves against the other repo and the pane reads the wrong issue.

* review(issue-pane): borrow the item's repo only when the item is the link

Review of the previous commit found two ways the repo choice could mislead.

`linkedIssue` and `linkedWorkItem` are separate slots and `linkedIssue` wins
(workspace-linked-issue.ts), so the number the pane renders can name an issue
while the work item is something else: a PR, a Linear task, or a different
number. The previous commit borrowed that item's repo unconditionally, so a
workspace created from PR #12 and later linked to issue #7 would have read #7
out of #12's repo. The repo is now borrowed only when the item is a GitHub
issue with the rendered number; anything else reads the workspace repo, which
is what it did before.

The silent fallback when the item's repo is not registered on this device is
gone. It restored the old read, resolving the same number in whatever project
the workspace repo happens to be — showing an unrelated issue is worse than the
unavailable state, and the failing RPC was a wasted round trip either way.

Tests: a PR, a different number and a Linear task each keep the workspace repo,
and an unregistered item repo renders unavailable without calling the lookup.

Left out of scope, noted on the PR: the workspace card still fetches
`linkedIssue` from the workspace repo (use-worktree-card-lifecycle-effects.ts),
so for these workspaces the pane loads while the card's decoration does not.

* fix(linked-issue): read a linked issue in the repo that owns it, everywhere

The Issue pane read its link out of the workspace's repo and sent the task source's repo id
with it, so a workspace created from a task on another host asked that host for a repo id only
this device has: "Couldn't load this GitHub issue" over an intact link. The pane was fixed
first; the same mistake was still live in the sidebar card's issue decoration, in both refresh
sweeps, and in how a re-linked number was read.

`linked-issue-repo.ts` now owns the rule once, and every surface calls it: the repo is the one
the work item came from when that item is this link, else the workspace's own repo. That
covers the sidebar card's cache key and fetch, the two refresh sweeps that key the same entry,
and the pane. `issueRepo` is threaded through the card lifecycle effects beside `repo` rather
than replacing it: PR and checks surfaces are about this workspace's git repo, not its issue.

Two things made the read incoherent beyond the repo choice:

- A creation-time source context can name a different repo than the row being read. Passing it
  along is what asked another host for a foreign repo id, so the pane now forwards it only when
  it names the row's own repo — consistent by construction, and still carries the account
  otherwise.
- A link that names a repo this device does not have rendered "Couldn't load this GitHub issue"
  and retried a read that cannot succeed. It now says so: `IssuePaneMessage` gains a
  `repoOffDevice` state, and there is no fallback to the workspace repo, because the same number
  in another project is a different issue.

The link editor stays scoped to the workspace repo, documented at the call site: it writes a
bare number, which displaces the work item, and the pane then reads that number in the
workspace repo — where the picker listed it.

Tests: a pure suite for the shared rule (all four identity cases, missing row, absent slice);
the card's issue cache key in three shapes; the pane's off-device copy and both source-context
guards. `pnpm tc:web`, oxlint, oxfmt, the changed-code gate and the localization catalog verify
are clean, and 1426 renderer suite files pass.

* fix(linked-issue): settle the card when the issue's repo is not on this device

The card's issue decoration is driven by a cache entry the review details key from the link's
repo. When that repo is not registered here there is no key, so the entry is `undefined`, which
the presentation reads as "still loading" — the card spun on a fetch that can never be made,
while the pane said the repo is missing. Before the repo moved to the link's repo this case
still ended in a failed fetch that cached `null`, so at least it settled.

`useWorktreeCardReviewDetails` now reports `issueRepoIsOffDevice` beside the entry, and the
presentation settles that link as unavailable. Two tests pin the settled and loading titles,
because the absent-entry case is exactly what the old code could not distinguish.

Also from the same review: the `readSourceContext` comment claimed it preserves the read's
account, which nothing selects from a source context — it scopes the cache and the host guard,
and the comment now says that. Dropped a duplicated cross-host pane test left over from the
previous pass.

* fix(linked-issue): cover both sweep paths and keep them linear in repo identity reads

The activation sweep (`refreshGitHubForWorktree`) still keyed and refetched a linked issue
through the workspace repo; only the full sweep had moved to the link's repo, so after a push
one path invalidated an entry the card never reads and refetched through the wrong repo.

Resolving the link's repo also has to stay off the O(N*M) path the sweep budget pins: an array
scan per worktree re-reads every repo row on every lookup. `findLinkedIssueRepo` now goes
through the store's memoised repo lookup index, which is what the sweep already builds, so the
pane, the card and both sweeps share one resolver and one pass.

Tests: the full sweep reads a cross-repo link from the item's repo, skips one that names a repo
this device does not have, and the existing identity-read budget test still holds.
nplez1 pushed a commit that referenced this pull request Oct 19, 2026
…iew off the deprecated owner resolver (stablyai#30562)

* refactor(renderer): fold browser creation, file actions and doc-preview callers off the deprecated owner resolver

The creation-action policy and browser creation (#3, #48) fold together, so the provider the
policy offers is the one creation uses. Browser panes, page lifecycle and conversion, tab
duplication, the explorer tree pane, doc-preview actions and editor path moves (#21, #43, #45-#47,
#49, #50) read runtimeEnvironmentIdWithLegacyFallbackUnlessTwin. File-explorer writes on a folder
(#51) take the owner from the rows alone, never from the focused server. Deprecated importers
16 -> 6.

* refactor(renderer): fold file preview off the deprecated owner resolver; Open in Orca Browser refuses a twin

A project two hosts publish reads as no server for the doc-preview plan, but the file:// path now
refuses it with its own message instead of opening this machine's copy (#7). Deprecated importers
6 -> 5.

* fix(renderer): a twin's file preview and open-externally refuse instead of opening this machine's copy

Codex P2 on the F7 folds: a folder twin read as no server, so the preview plan built a local
file:// tab and open-externally handed the path to this machine's OS. Both now check the owner
for ambiguity first. Also fix two test fixtures that broke the renderer typecheck.

* refactor(renderer): move the file:// open target out of file-preview.ts

file-preview.ts crossed its line limit after main grew it; the file:// target, its type and its two
refusal messages move to workspace-file-browser-open-target.ts, which they never depended on
file-preview for.

* test: mock the replacement resolver in the quick-action availability suite (Codex P2)
nplez1 pushed a commit that referenced this pull request Oct 21, 2026
…the same path (stablyai#31055)

* fix(runtime): project registration dedupes only against rows on this machine

Codex review 6 #7: create() matched paths across hosts, so creating a local
project at a path an SSH project used returned the SSH row and made no
directory. add() with no host had the same gap. One predicate,
runtimeRepoIsRegistrationCandidate, now backs add, create and clone.

* test(runtime): cover nested-SSH rows and clone reuse in host-qualified dedupe

Review follow-up (Opus P3s): runtime:<env> rows carrying a nested SSH
connectionId, add() for a runtime host, the clone controller, and a stricter
create() assertion.

* test(runtime): clone dedupe fixture commits without signing
nplez1 pushed a commit that referenced this pull request Oct 21, 2026
…p ones (stablyai#31096)

* feat(ci): ratchet raw repo connectionId host reads; one drop-in resolver

Codex review 6 class fix (#4/#6/#7): host decisions read off a repo row's
legacy connectionId miss rows that name SSH only as executionHostId.

- getRepoRoutingConnectionId (shared/execution-host.ts): drop-in for a raw
  repo.connectionId routing check that also finds executionHostId-only SSH.
- check-repo-host-read-ratchet: per-file count of raw repo connectionId
  reads in src/main, src/shared, src/cli; counts may only shrink.
- Migrated 66 cheap reads: runtime GitHub/GitLab commands, PR/MR head ref
  fetches, preserved-branch cleanup, ref queries, base-ref IPC, worktree
  preparation, trash sweep, scan cache TTL, usage metadata.

* fix(ipc): PR base IPC routes executionHostId-only SSH rows; ratchet is a stated lower bound

Review follow-up (Opus on stablyai#31096):
- worktrees:resolvePrBase decided git/gh routing on the raw connectionId while
  its head-ref fetches already used the resolver; one resolved connectionId
  now drives all of it (test fails on main).
- getRepoRoutingConnectionId's contract is stated exactly: never local when the
  raw field is set; on a contradictory ssh row executionHostId wins.
- The ratchet regex no longer matches report.connectionId; header and docs
  say it is a lower bound.
- Regression tests for a runtime GitHub and GitLab command site.

* test(ci): pin the repo host-read ratchet step to the static phase

* fix(ci): repo host-read ratchet skips verbatim field copies into projected rows

A copy of connectionId into a projected row decides nothing; migrating it to
the resolver would change what the projection publishes. The sidebar feed
catalog's copy (added after the baseline) and two older projections no longer
count; baseline pruned to 91.
nplez1 pushed a commit that referenced this pull request Oct 22, 2026
…ds a terminal asks main's layout (stablyai#32002)

* refactor(runtime): every reader of a terminal's pane goes through paneOfPty (L80)

With the layout-owner switch on, main's layout answers which tab and pane hold a terminal, and
nothing reads or writes the PTY record's tabId/paneKey copies or their graph stamp. Switch-off
reads the copies exactly as before.

* refactor(runtime): read a terminal's pane through the runtime's paneOfPty method

* fix(runtime): main's pane index answers paneOfPty before any window graph

A headless host never installs a window graph, so the query asked a publisher that did not exist
and every terminal read as paneless. The index is now made on first query; it publishes only once a
graph is installed, as before.

* test(runtime): pin that a query with no window publishes nothing

* test(runtime): a terminal summary reads its pane once (L80)

* feat(runtime): pin bind-first at registration, and one own-handle rule with or without a window (switch-on only)

* test(runtime): census and tests that every create path binds its pane before it registers (L80)

* test(runtime): a bind-first fixture that stands in for the spawn commit (L80)

* test(runtime): fixtures bind a terminal's pane before registering it, as the spawn commit does (L80)

Also, with the switch on: skip the bind-first check for a paired server's workspace, release a
closed tab's terminal ownership once main has dropped the pane, and publish a pane's agent status
from the terminal main's layout binds it to.

* feat(runtime): an exit after main's close still finds the pane it retires (switch-on only, L80 Q2)

Main's layout write records every pane it drops whose terminal no pane holds any more, in a new
optional session field closedTerminalPanesByPaneKey (same TTL and cap as closed-tab records).
Exit cleanup reads main's layout first, then that record by terminal id and incarnation, and
removes the entry it used. Older builds ignore the field.

* refactor(layout): one dropped-leaf step every live layout edit runs (switch-on only, L80 Q2)

The step receives each dropped pane (host, worktree, tab, leaf, terminal, incarnation), computed
across the whole layout so a moved pane is not dropped, and runs only for a commit that declares a
live edit. Today it records the closed-pane entries; a drop is recorded once per terminal.

* fix(runtime): a phone or headless tab close still stops and releases its live terminals after main's layout drops the panes (switch-on only, L80)

The headless close reads each row's live terminal before main's close drops the panes it is found
by, and a renderer-retired tab releases the owned terminal main left in no pane, as the explicit
close already did. Close tests now commit through main's layout and bind panes first.

* fix(runtime): a local workspace's terminal tab left in a paired server's partition is main's pane (switch-on only, L257)

Older builds could save a local worktree's tab rows into a runtime partition (stablyai#18202); its terminals
are local, so main's index takes those tabs for workspaces the router homes locally. A tab or
terminal the local partition also holds is indexed once, from there; SSH and server-owned
workspaces are skipped as before.

* test(layout): the legacy-close comparison leaves out the closed-pane record only layout-owner builds write (L80)

* test(pty): a pane whose failed start withdrew its tab resolves to terminal_not_found in layout-owner builds (L80 #7)

Main's layout no longer holds the pane, so there is no pane to answer for; window-owned builds keep
the disconnected stub from the exited terminal's record.

* test(runtime): orca-runtime suites bind panes first, as the real store and spawn commit do (L80)

Fake PTY spawns commit the binding into the pane the runtime wrote, stores list their partitions,
and SSH sessions sit in their ssh:<conn> partition; terminals registered directly bind first.

* fix(runtime): main's layout names a pane's terminal only when the workspace and stamped incarnation match (switch-on only, L80)

A record made before its adoption registers (a host restart) or a local id reused after one
matched a saved binding by id alone, so a phone or paired desktop could be handed a second handle
for the pane before the terminal's own handle arrived and stay on it.

* test(runtime): a restored pane is only unnamed in the adoption gap, and no local record rescues a paired server's tab (L80)

* test(runtime): recovery, close and routing suites set up terminals as production does (L80)

A recoverable pane is one the host inventory dropped with no exit, live terminals register
rather than appear only in the window graph, and SSH stores route as the real Store does.

* test(runtime): suspects 3, 4 and 5 bind, register and apply as production does; PR-1's main-layout closes in the part-10 and part-11 close tests (L80)

* test(runtime): a fixture store applies main's layout commands as a profile does; PR-1's own closes in the part-05, part-08 and UUID-leaf close tests (L80)

* test(runtime): the profile-store stand-in moves to its own fixture, keeping bind-first under the line limit (L80)

* test(runtime): orphan adoption reads the pane from main's layout with the switch on, not the record copy (L80)

* test(runtime): a phone's pane close and a pinned tab close are main's layout closes with the switch on (stablyai#31571), in the no-widening and surface-close tables (L80)

* test(runtime): a paired phone close commits in main's layout with no relay ack when the switch is on (stablyai#31571) (L80)

* fix(terminal): a parked pane resumes its agent once main has closed the other pane that held the session (layout-owner build, L80 P1)

* test(runtime): the parked-pane suite's restart holder is a saved pane with no registered terminal, under the line limit (L80 P1)

* fix(terminal): a spawn commit that binds a reused local terminal id unbinds it from the saved pane of the older process (layout-owner build, L80 P2)

* test(runtime): the legacy OSC row test uses the UUID leaf main's layout holds and registers its live terminal with the switch on (L80 E5)

* test(runtime): the pty-exit echo close of a dead headless tab is expected to fail with the switch on until W4's close PR (L255)

* fix(terminal): a terminal record that arrives, changes incarnation or moves workspace after main composed its panes re-composes them, so a restored pane lists once (layout-owner build, L80)

* fix(terminal): a pane bound to a terminal a paired server runs keeps that binding and host, and is never indexed as a local spilled tab (layout-owner build, L80/L257)

* fix(terminal): a pane main owns no longer proves its terminal runs; the host's inventory and the terminal's record decide, so a dropped shell reads disconnected (layout-owner build, L80)

* fix(terminal): an SSH pane whose host says its shell ended keeps its leaf on a negative or failed code, as the window does, so recovery starts a shell in it; a stale handle learns the connected replacement (layout-owner build, L80)

* fix(agent-launch): a terminal main's layout still binds counts as running through a host listing gap, so a launch never starts a second shell in its pane (layout-owner build, L80)

* fix(terminal): a disconnected terminal main still binds stays a stop target, never reads stopped unproven, and keeps an exit wait waiting until a certified exit (layout-owner build, L80)

* test(terminal): the wait unit fixture answers the exit-settled dependency

* test(terminal): realistic fixtures for three phone-row tests: unique leaf ids per pane, and a window that draws main's own panes (layout-owner build, L80)

* fix(terminal): a stale handle learns a pane's replacement only when it was resolved for that pane, its own terminal ended, and the replacement is connected there now (layout-owner build, L80)

* test(session-tabs): switch-on variant for a window's chat placement (main's layout order rules); headless phone tab order is L283

* test(terminal-close): switch-on close reds name their ledger rows (L255, L256, L259a, L259b); a same-id respawn's commit stamps its incarnation; the crossing terminal binds first

* test(terminal): the crossing registration is refused by main's workspace fence (L256 switch-on variant); the placement test's tabs are main's saved layout

* refactor(terminal): the stale-handle guard reads an issue-time pane stamp on the handle record, not a second map; moved-pane, restart and single-reader tests (layout-owner build, L80)

* test(session-tabs): switch-on variants: the desktop's tab name is main's rename, and a mobile-created tab's live shell is the one its commit registers (layout-owner build, L80)

* fix(terminal): a re-issued handle keeps its issue-time pane while no pane holds its terminal (review)

* fix(terminal): stop targets and exit waits use main's holds check (workspace and incarnation), and any exit event settles a later wait (review)

* test(session-tabs): name the switch-on placement and split-group reds L288 and L289

* fix(terminal): an exit drops a closed pane's record in the same write that retires the pane, and an unbind folds into the binding write (layout-owner build, L80)

The exit used to remove main's closed-pane entry in a session write of its own, before the
retirement write. It now reads the entry, and the retirement write for that pane drops it,
re-checked by terminal id and incarnation. An exit that keeps the surface (relay contact lost,
intentional stop) keeps the entry until a confirmed exit or its TTL.

A reused terminal id's unbind is now a pure computation that applyPtyBinding applies through
its existing writes. Two split-pane tests still expected a -1 exit to close the pane; they now
follow the ruling that any negative code keeps it. Static-gate fixes: test fixtures and tests
use typed member access instead of Reflect, and no longer use type assertions.

* test(runtime): the shared fixture store announces its session writes and the L283 store lists its partitions, as a profile Store does; L289's test passes on that store (layout-owner build, L80)

The fixture store bindPaneFirst fills now tells write listeners of every session write, direct or
by a layout command, so main's post-commit merge runs as it does on a real Store. The notice is
not enumerable, so a test's own `{ ...store }` copy, which keeps its writes elsewhere, does not
inherit a subscription it would never fire. With it, the targeted split-group create (L289) passes
at this head, so its it.fails mark goes. L283's test runs on a store that names its partitions and
stays it.fails("L283").

* fix(terminal): recovery checks the caller's handle after the cheap guards again, so the switch-off build re-issues no handle on a refused recovery (layout-owner build, L80)

The stale-handle switch point had moved the handle lookup ahead of the pane, terminal and
workspace checks. That lookup can re-issue a handle, so a switch-off recovery refused on those
checks gained a side effect base never had. The lookup runs after them again, and the switch-on
replacement check lives in one method.

* test(runtime): the layout-owner start fixture's spawn commits the pane binding before main registers the terminal, as the host does (L80 switch-on variant)

The window-tab start test came in with the main merge after bind-first; its fake spawn returned
a terminal no pane was bound to, so registration refused it. The fixture's spawn now binds the
pane first, as every other bind-first fixture does.

* fix(terminal): a new process under a reused terminal id starts with no exit code, so an exit wait on it cannot settle on the old process's code (layout-owner build, L80)

The record of a reused id kept the earlier process's lastExitCode, and with the switch on an exit
wait settles on any recorded code once the terminal reads disconnected. A new incarnation now
clears the code and cause. Also drops the L283 test's partition-list option: the fixture store
already lists its partitions.

* test(runtime): switch-on variants for four tests the full local run never loaded (L80)

- A restored pane's host lists the terminal it started; a pane main owns vouches for none.
- The other pane holding a slept session is in main's layout, so an unverifiable holder blocks
  the resume as it does through a window.
- Main sleeps a workspace whose panes it lists itself, even with a renderer attached (stablyai#31571).
- A graph sync no longer reconnects a disconnected terminal of main's pane; the inventory decides.

* test(runtime): the phone Markdown route tests use stablyai#31667's realistic store, and the untitled cases wait on L268 with the switch on

The window's tab uses main's id (the file path), and the store lists its partitions and saves each
open editor's unified tab and group, as the window does (the fixture from stablyai#31667). With the
switch on, the three untitled cases fail on L268, main's row merge dropping the untitled flag,
which stablyai#31667 fixes; they are it.fails until A1b's history includes it.

* refactor(runtime): two merged files back under the line limit, by moving A1b's additions to their helpers (L80)

After the main merge, the holder-pane check and a closed tab's live-terminal lookup pushed two
files past the line limit. The holder check is now paneHoldsSession (main-terminal-surfaces.ts)
behind one method, and the closed tab's lookup is one parent-class method. Behaviour unchanged.

* test(runtime): the headless chat tests open the chat on the publish path, as every product path does; L283 stays it.fails for the main-owned reorder

openChat recorded the chat only in the runtime's snapshot, so main's layout never held it and the
phone's reorder was refused as an unknown tab. On the publish path main's layout holds it; the
reorder is accepted but does not survive the row rebuild after a close (L283, reopened).

* test(runtime): bind-first census follows the one spawn-commit step (stablyai#31596); the unbound-registration test keeps its spawn from the suites' stand-in commit

After the main merge both start lanes register in spawn-commit-assembly.ts, after
savePtySpawnPaneBinding (or, adopted, on the live owner's pane); the census lists that file. A
phone create now writes its pane before the spawn, so the suites' stand-in spawn commit bound it
and the test of a path that registers unbound passed for the wrong reason; that test's controller
now opts out of the stand-in commit.

* test(runtime): convert four switch-on tests the disguised full runs hid

Real switch-on runs showed four files whose fakes registered terminals unbound
or confirmed a stop without its exit. Bind first, stamp the source as main
does, and deliver the exit a confirmed stop delivers. Switch-off unchanged.

* test: type the two converted fakes instead of casting them

The PTY controller fake now takes the controller's optional pane fields, and the
switch-on store is a typed RuntimeStore, so neither needs an assertion.
@nplez1
nplez1 deleted the nplez1/Agent-Dash-go-to-workspace branch October 24, 2026 03:23
nplez1 added a commit that referenced this pull request Oct 30, 2026
#253)

* feat(issue-pane): pick between a workspace's issues in the pane header

A workspace can hold several issues; the pane only ever showed the active
one. The header's identifier is now a split control: it still opens the issue,
and a chevron lists every attached issue (provider mark, identifier, title)
with the shown one checked.

The selection is the pane's view, not the workspace's active link: the active
issue is one compatibility slot per provider, and clearing a slot deletes the
attachment, so promoting one across providers would unlink a sibling rather
than reorder them.

Unlinking now removes the issue the pane shows instead of one slot per
provider, which would have unlinked an issue the user is not looking at.

* fix(issue-pane): join the link menu and the fork's string catalog after the sync

The sync's link work gives every non-anchor web affordance the app's link
menu through `data-link-url`, so the pane's identifier declares the address it
opens.

`verify:localization-extraction` now fails on a translated key with no catalog
entry, so the switcher's label joins the fork overlay.

* fix(issue-pane): name every provider the switcher cannot render, so the switch is exhaustive

* fix(lint): clear the four reds the sync brought in with nplez1/main

None of these are this branch's files; they arrived through the merge and
`local/gate-lint.mjs` reports them as new reds, so PR gate 1 could not pass.

Fixed rather than exempted, except the line counts the fork allowlists to keep
upstream merges cheap:

- `test-no-wall-clock` in the three AI Vault scanner parser tests dated their
  fixture by the wall clock; they now use a fixed instant, because the parser
  only carries the mtime through.
- `test-no-real-time-wait` in the session-fold tests used a 1 ms and a 20 ms
  sleep to keep a fake brain in flight; a zero-delay yield does that without
  making the test the clock's problem.
- `vm-recipe-extend.test.ts` measured a hang guard with `Date.now()`; a
  monotonic `performance.now()` is what an elapsed-time assertion wants.
- `contextual-http-link.ts` is a transitive Link Routing reader, the same
  accepted class as `use-linked-issue-pane-actions.ts`, so it joins the
  focus-read overlay with its reason.
- `tests/tools/upstream-file-comments.test.mjs` shipped a literal
  `eslint-disable max-lines` inside a fixture, which the max-lines ratchet
  read as a real suppression; the fixture assembles the directive instead.
- `src/cli/handlers/vm.ts` is upstream's file carrying the fork's VM recipe
  entry points, so it takes the inline exemption every other over-cap upstream
  file has, and the stale `register-core-handlers.ts` row is pruned.
- The comment budget for upstream files grew with the sync's link work, so the
  baseline is regenerated with that reason recorded.

* fix(issue-pane): read a picked GitHub issue from its own repo

Round 1 (Opus 5.5, high) found one blocking defect and three minors.

The blocker: the resolver dropped an attachment's `repoId`, so a GitHub
issue picked from the switcher that is not the workspace's active link was
read from the workspace's repo. In a folder workspace (synthetic repo id) it
showed nothing; in a worktree it could read the same number from another repo,
which is the "unrelated issue of the same number" failure `linked-issue-repo`
exists to prevent. The GitHub issue now carries its attachment's repo, the
repo lookup takes it, and the issue's identity is repo-scoped so `#7` in two
repos is two entries — including for the unlink target.

Minors: the Linear pane's unlink target now names the linked identifier rather
than the fetched one, so a moved issue still resolves to its attachment; the
switcher test's `openUrl` override no longer turns an explicit null back into
the default; and a test pins that a picked issue's own account drives its reads
instead of the workspace's.

* test(issue-pane): pin the Jira arm of the picked issue's account, closing the last review MINOR
nplez1 added a commit that referenced this pull request Nov 1, 2026
… Source Control (#267)

* feat(right-sidebar): pick between a workspace's reviews in Checks and Source Control

A workspace can hold several review attachments while its compatibility slots
name only one active review, and both panes only ever showed that one. The
Checks pane's review number and the Source Control header's review link are now
split controls: the link keeps opening the review, and a chevron lists every
review the workspace holds (`PR #12` / `MR !7`, with the title) and switches
which one the pane describes.

Switching drives the panes' reads, not just their labels:

- Checks re-reads checks, comments and review metadata for the picked review's
  number, drops the previous review's rows while that read is in flight, and
  maps the review onto the PR shape the pane already keys its head-sha
  freshness gate and comment actions on.
- Source Control's header link, review actions and compare base follow the
  pick. The file list, commit area, push target and PR creation keep resolving
  through the workspace's own review: pointing those at another branch's
  review would retarget a push.

The selection is the panes' view, not the workspace's link. It lives in the
fork's session-only renderer slice, keyed by worktree and shared between the
two panes so they cannot disagree, and never moves `linkedPR` — that slot is
what push-target and PR-creation safety resolve through. It is keyed on
provider and number rather than the attachment key, which moves when a
background refresh fills in a title or URL.

Unlinking now removes the review the switcher shows instead of the workspace's
slot, so it cannot unlink the review the user is not looking at. A picked
review is read through its own hosted-review cache key, so switching does not
overwrite the branch's review entry, and the Checks Refresh button refreshes
the picked review rather than the branch's.

* fix(right-sidebar): close the two blockers the review found in the review switcher

Round 1 (Opus 5.5, high) found two blocking defects and six should-fix items.

The first blocker: the Checks pane's Refresh took its number from any picked review,
so a picked GitLab MR sent `!7` to GitHub as PR #7 and a picked Bitbucket PR reused the
branch PR's head. The picked path now branches on the provider the pane actually
renders — GitHub checks and comments for a GitHub review, `fetchGitLabDetails` for an
MR, and the branch path for anything this pane cannot render.

The second: both panes cleared the shared pick whenever their own default matched it.
Their defaults come from different async sources, so a transient null in one pane wiped
the other's pick. Nothing writes the selection from a derived condition any more; the
selection's flag stays a per-pane render decision, and a stored key that names another
pane's default is simply that pane's default.

Should-fix items closed:

- The Checks switcher lists only reviews this pane can render, and its checked row is
  the review the header shows, so a listed row is never a review that is not on screen.
- Every "is a pick shown" decision reads the same value: the PR-check fetch no longer
  passes this worktree's branch for a picked review, which had been writing another
  PR's check status onto this branch's cached PR.
- Refresh-after-mutation and the entry refresh follow the pick; the triage strip's
  worktree-acting AI actions are hidden for a pick, because they start an agent in
  *this* worktree and would fix another branch's checks by committing here.
- Unlinking removes the row that carries the shown review and tombstones a GitHub one,
  so a slot-only clear cannot leave the review behind, and a failed update now reports.
- The selection is memoized, rows clear with a loading state, and the Refresh of a pick
  keys its results on the refreshed head instead of discarding them.

Tests cover the decision everything downstream reads (`shown-review.test.ts`), both
provider branches of a picked Refresh, the picked unlink, the header with a pick, and
that the hook never writes the shared selection on its own.

* fix(right-sidebar): close what the delta re-check found, including one regression of its own

The delta review (Opus 5.5, high) confirmed both round-1 blockers resolved and found
one blocker and three should-fix defects introduced by those fixes.

The blocker: the picked Refresh's staleness guard compared `asyncResultKeyRef.current`
with itself, which always passes, so a switch mid-flight wrote the old pick's rows
under the new review's header. The key is now captured locally, assigned to the ref,
and compared as a local — and the loading flags are cleared only by the request that
still owns them.

Should-fix items closed:

- `findWorkspaceReviewAttachment` matched issues too. A GitLab issue and an MR have
  separate number spaces, so unlinking `!42` could remove the issue `#42`; the search
  is filtered to review attachments, with a test that shares a number.
- Unlinking a picked GitHub review overwrote the `suppressedGitHubPR` tombstone of a
  branch PR the user had already unlinked, letting that PR come back. The tombstone is
  written only for the workspace's own review, which is the only one the branch lookup
  can resolve.
- The row-clear effect raised the loading flags on mount and on every return to the
  workspace review, where nothing guarantees a matching clear. It now runs on a switch
  only, and raises the flags only for a pick.

Minor items closed: the shared pick is cleared only when it names the review being
unlinked; Unlink is disabled again for a review with no row and no slot, whose unlink
would do nothing; the switcher never checks a row the header is not showing, in either
pane; a picked GitHub read no longer clears this branch PR's refresh error; and a
picked MR is re-read on tab entry and after a mutation, like the branch path.

Two round-1 gaps in coverage are also closed: the picked Refresh's guard is now
exercised with a real comparison and a mid-flight switch, and the polling path is
pinned to pass no branch for a pick.

* fix(right-sidebar): stop a mid-refresh switch from claiming the next review's result key

Round 3 (Opus 5.5, high, on the R2..R3 delta) confirmed eight of the nine round-2
findings resolved and found that N1 was only half-closed.

The remaining hole: after `refreshSelectedReview()` resolved, the picked Refresh only
checked `isCurrentRequest()`, which a review switch does not invalidate. It then claimed
`asyncResultKeyRef.current` with the *old* pick's key, so the old review's rows landed
under the new header and the new review's own in-flight read was discarded. The GitLab
sub-path had the same shape, passing no currency predicate to `fetchGitLabDetails`.

The fix answers "is this still the review on screen" from the stored selection rather
than the result key: the result key cannot tell a switch from the refreshed review
landing with a new head, which is the refresh working. Both the claim and the loading
flags now sit behind that check, while the refresh latch stays on the request alone so
it is always released.

Also closed: a pick whose row no longer matches no longer falls through to the branch
slot path, which would have addressed a review that is not on screen (and could write
the pick's number over an earlier branch-PR tombstone); the duplicate dependency in the
entry-refresh hook; and the redundant provider guard, now that
`findWorkspaceReviewAttachment` returns the narrowed attachment type.

Coverage added for the round-2 items that had none: a switch inside
`refreshSelectedReview`, an issue and an MR sharing a number with no URLs (asserting the
issue survives the removal), no tombstone written for a pick, no slot path for a pick
with no row, and no branch-PR error retraction from a picked read.

* test(right-sidebar): make the picked-refresh and picked-unlink assertions able to fail

Round 4 (Opus 5.5, high, on the R3..R4 delta) came back clean: no blockers, no
should-fix, and all seven round-3 findings resolved. Its three NITs were all about
tests that could not fail, so they are worth closing even though a NIT never blocks.

- The tombstone assertion used `expect.not.objectContaining({ suppressedGitHubPR:
  expect.anything() })`, which passes for a write of `suppressedGitHubPR: null` —
  exactly the write that would clear an earlier branch-PR tombstone and let that PR
  come back. It now asserts the key's absence.
- The mid-refresh-switch test now also pins that the result key was never claimed and
  that the refresh latch was released; a regression gating the latch on the pick check
  would have left Refresh disabled for good with no test failing. A second case switches
  the selection after the key was claimed, so the post-read pick check has its own test
  instead of relying on the result-key half.
- The issue/MR number-collision test moved to the GitLab unlink block, where it belongs,
  and its comment was wrong.

Both new guards were checked against their own absence: removing the post-read pick
check fails the claimed-key test, and removing the pick-with-no-row guard fails the
no-row test. The issue/MR test already discriminated, since the removal is keyed on an
attachment identity that folds in the type.

One round-4 assumption was checked and left alone: the GitLab details path clears its
loading flags on an abandoned request, which looks like the round-3 flags bug but is
deliberate — a generation counter keeps it off a newer request, and an upstream test
pins that an abandoned relink must release them or the pane keeps a spinner forever.
Adding a currency guard there broke that test, so the change was reverted rather than
the contract.
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.

1 participant