Skip to content

feat(native): side chats, subagent lineage, child approvals, provider subagent bar - #45

Merged
rynfar merged 6 commits into
nativefrom
nw/w11-lineage
Nov 2, 2026
Merged

rynfar merged 6 commits into
nativefrom
nw/w11-lineage

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner

The native client showed subagent rows but had no side chats, no child-thread approvals on the parent, no bar for provider-native subagents, and a Lineage section that only listed shell parents and children. This ports TV-SIDECHAT and most of TV-LINEAGE.

What changed

Core (pure, tested)

  • crates/core/src/lineage.rs ports threadRelationships.ts:
    • the graph with parent, fork, subagent and transfer edges, plus row status, ordering and the merge-back target;
    • resolveLatestMergeBackRun;
    • the panel's grouping (related / active / previous / side chats);
    • relationshipLabel and threadRelationshipStatusLabel;
    • the thread.merge_back, subagent.stop and orchestration.stopWorkflow payloads.
  • crates/core/src/lineage/subagents.rs covers:
    • subagent records, deriveThreadTurnSubagents and its pill;
    • workflow groups from subagentRuntime.ts;
    • formatSubagentDisplayTitle;
    • deriveProviderSubagentStatus and formatProviderSubagentStatus;
    • formatModelSelectionEffort with the reported selection;
    • canStop and canStopWorkflow;
    • getNativeChildWork decoding.
  • crates/core/src/side_chat.rs: the fork, first-message and delete commands from useSideChat.ts, sideChatsOffered and sideChatDisabledReason, Bring back's blocked reason, and the tab dot state.
  • SurfaceKind::SideChat (side-chat:<thread>) persists like the web. Reopening a closed tab skips a side chat the server deleted.
  • Wire additions: forkedFrom on shells and threads, workspacePreparation on runs, and the sideChats capability.

App

  • Side chat tabs (crates/app/src/side_chat/):
    • The tab shows the side chat's title and a static dot: info when it needs approval or input, muted_foreground while running.
    • The pane has a header over the side chat's own transcript and composer. Bring back shows why it is unavailable. Delete uses the OS confirm when confirmThreadDelete is on. Close closes the tab.
    • ThreadView and Composer gain an embedded mode pinned to one thread. Rewind and the sync line read that thread.
    • AppState keeps side subscriptions next to the open thread's: the visible side chat tab, and children that ask for an approval. Selecting such a thread adopts its live state.
    • Closing a tab sends thread.delete with onlyIfUnused.
    • The launcher and the add menu offer "Side chat" when the server supports it, disabled with the web's reason otherwise.
    • AppState::open_side_chat(Some(prompt)) is the hook W2c's /side and /btw call.
  • Composer area (crates/app/src/lineage/):
    • ChildThreadApprovals sits above the composer, with every approval option, the not-live warning, and inline errors.
    • ProviderSubagentBar replaces the composer on provider-native subagent threads. It has the model, effort and status (ticking at 1 Hz only while working), "Runs on its own", Open parent, and Antigravity's "Subagent work" dialog (NativeChildWorkDialog).
  • Thread details card:
    • Lineage now uses the relationship graph, including the idle family rows the shell omits. It shows parents, forks, subagents and transfers with status labels, and titles fall back to the subagent's prompt as projectedSubagentsToRuntime does.
    • Merge back is a split action on the fork's source. Stop subagent or Stop workflow appears where the web's rules allow it.
    • A new Side chats section (sideChats details item) opens each side chat in its tab.
  • Related-thread links (subagent rows, the child-input line, lineage) open a side chat in its tab instead of navigating away.
  • Snapshot tool: --right-panel side-chat:<thread> shows an existing side chat of --thread. It never starts one, so it stays read-only.

Not in this PR (both ledger rows stay partial)

  • The composer's /side and /btw (W2c owns triggers).
  • The launcher's S key. Today the launcher only shows key labels.
  • Routing a side chat's tool diffs and shell commands into the parent's panel and terminal (SideChatParentPanel).
  • The transcript's "Context from" / "Subagent of" parent link.
  • Remote-subagent and delegated-from rows, Disconnect agent session, a collapsible "Previous agents" group (those rows show inline), workflow opening blocks, and subagent tooltip metadata.

Evidence

  • cargo test --workspace, cargo clippy --workspace --all-targets -D warnings, gen-theme --check, vendor-icons --check, parity/sync.test.ts and conformance --check all pass. 22 new core tests cover lineage, side chats and right-panel persistence.
  • Screenshots (offscreen snapshot tool):
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code/7a9093f7-05bd-4183-ab15-c4265aa48126/scratchpad/shots/w11-side-chat.png (smoke server). It shows:
      • the side chat tab with its dot;
      • the pane header and the embedded transcript waiting for approval, with the embedded composer's approval and stop;
      • on the parent: the "Side chat needs approval" line, the child approval card above the composer, and the details card's Side chats section.
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code/7a9093f7-05bd-4183-ab15-c4265aa48126/scratchpad/shots/w11-lineage-real.png and w11-lineage-real-crop.png (real-data server, read only): Lineage rows for a thread's subagents with Done and Stopped statuses, titled from their prompts.
  • Smoke server (devReplay): a headless probe ran the full side chat lifecycle against the unmodified server:
    • Fork returned sequence:2035, and the chat is hidden from lists (sideChat=true, listed=false).
    • The first message triggers the server's first-turn approval, and the parent's child inputs read "2 side chats need approval".
    • After approving, Bring back merged the finished run (sequence:2085).
    • The onlyIfUnused delete kept the used chat, and a plain delete removed it.
    • Every side chat the probes created was deleted afterwards.
  • Real-data server, read only: subagent records decode 3/3, and grouping and turn rosters derive. Nothing was written there.

Model and harness: Claude Opus 5.5 via Claude Code (native-client factory worker W11).

@rynfar
rynfar merged commit 946a809 into native Nov 2, 2026
rynfar added a commit that referenced this pull request Nov 2, 2026
* fix(native): Stop targets the displayed thread and works for subagents on older servers

A side chat's background Stop stopped the open thread instead of the side chat.
App-owned subagent Stop always sent thread.stop for the child, which older
servers reject; it now falls back to run.interrupt on the child's active run.
A finished task whose child thread runs again keeps its Stop, as the web's
currentSubagent reads the child's live run.

* fix(native): subagent effort shows the explicit choice and never guesses a default

The label read the provider's report before the selection, took reports for a
different model, and normalized an unknown value to the catalog default.
It now follows formatModelSelectionEffort.

* fix(native): side chat shortcuts act on the side chat

Composer chords (model picker, permissions) went to the open thread's composer.
Each composer now handles its own, and the open thread's chat shortcuts ignore
keys from a side chat pane, as the web's isInSideChatPane does.

* fix(native): provider subagent bar sizes by its column, not the window

A docked right panel narrows the chat column on a wide window. The bar now
measures itself and uses ProviderSubagentBar's composer-surface breakpoints.

* fix(native): side chats let go of deleted threads, closed panes and other environments

A deleted side chat whose tab stayed saved kept its stream; a closed tab kept
its pane with caches and subscriptions; switching environments kept side
subscriptions and a pending start. Right panel tabs are now saved per
environment, as the web keys them by scopedThreadKey.
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