Skip to content

feat: subagents, side chats and linked threads open the same way - #39515

Open
juliusmarminge wants to merge 2 commits into
t3code/links/connect-to-interactfrom
t3code/links/unified-side-threads
Open

juliusmarminge wants to merge 2 commits into
t3code/links/connect-to-interactfrom
t3code/links/unified-side-threads

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Stacked on #39439 (which is stacked on #39406).

Problem

Three kinds of "a thread beside the one you are in" each opened differently and each had its own view. A side chat always opened in the right panel. A subagent always replaced the main screen. A linked environment's read-only thread opened as a third kind of panel tab with its own header, and had no main-screen view at all.

Change

One rule (web and desktop). A plain click, or Enter, on a subagent, a side chat or a linked read-only thread opens it as a tab in the right panel. Cmd-click (Ctrl-click on Windows and Linux), middle-click and Cmd/Ctrl+Enter open it in the main view. The context menu on those rows, cards and chips offers Open in side panel and Open in main view.

A setting. Settings → Chat → Subagents and side chats → Open subagents and side chats in (Side panel, the default, or Main view) picks what the plain click does. Its description names what the modifier does for the current choice ("⌘-click or middle-click opens it in the main view instead", or "…in the side panel instead"). It is a client setting with a reset, and settings search finds it for "side panel", "subagent", "side chat", "linked thread" and "middle click" (asserted in settingsSearch.test.ts).

One surface, one pane. The side-chat panel surface becomes a general thread surface (thread:<id>). Whether it is a side chat or a subagent comes from the thread's own lineage, so the surface only names the thread. SideChatPane becomes SideThreadPane, with one header for every kind: title, what only that kind offers (Add to chat and Delete for a side chat, as on main since #38323), Open in main view, Close. The linked thread tab uses the same header. Tabs share title, icon, dedupe, close, reopen-closed-view and the narrow-window sheet.

Only the bottom differs. Side chat and a subagent you delegated: the normal composer. A subagent the provider started: the read-only bar it has today. Linked: the read-only bar with Connect to interact.

Main view for all three. Side chats and subagents use the normal thread route. A linked thread gets a new read-only route, /linked/$viaEnvironmentId/$environmentId/$threadId, built from the same timeline and bar as the tab, with the same failure states. It is deep-linkable, and redirects to the real thread once this client is connected to that environment.

Back the other way. Open in main view in the tab header and in the tab's context menu moves the tab to the main view. From the main view of a subagent or side chat, the existing parent link still works.

Mobile. Subagents and side chats already opened in the inspector where the layout has one. A linked read-only thread now does too, with the same inspector header, and Maximize takes it full screen. Phones keep the existing screen. No modifier and no setting on mobile.

One body

#39406 was reworked underneath this PR: a linked thread is now the thread's own stream, reduced by the same reducer and drawn by the same MessagesTimeline as every other thread (ReadOnlyThreadTimeline). So the section this PR used to have, "Where the linked view shows less", is gone, and so is the code behind it. LinkedThread no longer adapts a transcript; it is the shared header, the standard timeline and the read-only bar.

What this PR does on top so the three bodies match on web:

  • Gutters. The timeline's side gutters come from the chat canvas ([data-chat-canvas] .messages-timeline-scroll), which the read-only timeline did not have, so a linked thread's rows ran edge to edge. LinkedThread now gives its timeline the same canvas gutters, and its bar, notices, loading and error states sit in the chat's composer lane (chat-composer-lane) with the composer's bottom gap, in the panel and on the main screen. This also replaces the page-only column class the old transcript needed.
  • User messages and the work-group disclosure are the timeline's own rows, so they are identical by construction.
  • Nothing that cannot work is offered. In a read-only timeline (a linked thread, and the guest page) no thread can be opened, so a subagent card there is plain content: no click, no modifier, no context menu. Before, the guest page would have shown Open in side panel / Open in main view on it, and both did nothing.

What still differs, by design: the linked view takes no input (read-only bar with Connect to interact), files, images and published visuals stay on the linked machine, and the rows that need the thread's environment (diffs, fork, revert, approvals, other threads) are absent, as on the guest page.

Not matched exactly: the chat measures its scrollbar and subtracts it from the gutter; the linked view does not, so with classic (non-overlay) scrollbars its gutter is wider by the scrollbar's width. The chat's composer floats over the end of the timeline; the linked bar sits below it.

Decisions where the spec was silent

  • Two surface kinds, not one. thread covers side chats and subagents. linked-thread stays separate because its identity is different (reading environment + environment + thread, with a label and title it carries until the first read). They share the pane header and tab behaviour.
  • Saved state keeps decoding. Saved side-chat surfaces, a saved active side-chat: tab id, and closed-tab history all migrate to thread. Covered by tests.
  • The panel is the thread you are in. A side thread opens in the panel of the thread the click happened in. A thread never opens beside itself, and a subagent's own parent opens in the main view only.
  • "Open in main view" moves the tab. It closes the tab without Close's cleanup, so an unused side chat is not deleted by the move.
  • Closing a tab deletes only an unused side chat, as before. A subagent tab just closes.
  • A remote subagent on an environment this client is connected to still opens in the main view only. Its diffs, terminal and files belong to another environment's workspace, which the host panel cannot serve. Its context menu offers only Open in main view.
  • A linked chip outside a thread (no panel to open in) now opens the main-screen route.
  • Ordinary thread chips, parent, fork and transfer rows navigate as before.
  • Embedded subagents lack what embedded side chats already lack: the chat header, turn diffs and fork-from-run. Open in main view has them.
  • Hints "Open subagent in this chat" / "Open side chat in this chat" became "Open subagent" / "Open side chat", since the destination now depends on the click.

Not done

  • Command palette and sidebar: I found no palette entry that opens a side chat or subagent specifically. Threads listed there navigate to the main view as before.
  • Mobile body. The linked view on mobile is the base's small read-only list (messages and one-line activity rows), not the thread screen's feed, so it does not yet look like a subagent or side chat there. The header and inspector behaviour match.
  • Mobile linked maximize uses a new LinkedThreadFullscreen route with the same presentation as ThreadInspectorFullscreen. It has not been run on a device.
  • Web was run for real between two dev servers (nucbox, with a full-access link to fs-17). A plain click opened a local subagent and a linked thread as tabs in the same panel; Ctrl-click opened the subagent in the main view; the tabs survived a reload. Mobile has not been run on a device.

The second screenshot is out of date: it shows the old paged transcript. The linked body is now the standard timeline with the chat's gutters. The header and the bar are unchanged. The web run described above was before the rebase; nothing was run in a real client after it.

Right-click a subagent A subagent tab and a linked-thread tab in one panel (out of date)
Context menu with Open in side panel and Open in main view Linked thread tab with the read-only bar

Scope

Maintainer feature work, requested by Julius.

Verification

  • Rebased onto the reworked feat: read a linked environment's threads from the client #39406 and feat: connect to a linked environment from its read-only thread #39439. vp run check:changed passes: format, lint, knip, typecheck (42 packages), tests (55 files), React Compiler.
  • vp run i18n:check passes. New web strings are translated in all ten locales. Mobile added no strings.
  • Logic tests: click → target (setting × intent × panel available), kind classification, which composer a kind gets, modifier per platform, the mobile inspector-or-full-screen decision (packages/client-runtime/src/sideThread.test.ts); surface dedupe, own-thread guard and legacy decoding (rightPanelStore.test.ts, closedViewStore.test.ts); the open helper (lib/sideChatPane.test.ts); the mobile linked opener with and without an inspector (thread-inspector-navigation.test.tsx).
  • Browser tests updated: lineage row (click → tab, modifier → route), linked chip (click → tab, modifier → /linked/…), timeline subagent card. One added: a provider subagent tab renders the shared header and its read-only bar, and Open in main view moves it. Rerun after the rebase with --project browser: ChatView, RightPanelTabs, MarkdownThreadLink, MessagesTimeline, ThreadRelationshipsControl, GuestPage (117 tests). The read-only context-menu gate has no test of its own: no fixture renders a subagent card on the guest page.

Steps to reach each state (for captures)

  1. Subagent in the panel: open a thread with a subagent, click its card in the timeline or its row under Agents in thread details.
  2. Side chat in the panel: send /side question, or click a row under Side chats in thread details.
  3. Linked read-only tab: on a thread whose agent delegated to a linked environment this client is not connected to, click the remote subagent row or a thread chip pointing there.
  4. Main view: Cmd/Ctrl-click or middle-click any of the above; or right-click → Open in main view; or the header button in the tab. For the linked thread this lands on /linked/<via>/<environment>/<thread>.
  5. Context menu: right-click any of those rows, cards or chips, and a subagent, side chat or linked tab in the panel tab strip.
  6. Setting: Settings → Chat → Subagents and side chats, or search "side panel".
  7. Narrow window: shrink below the panel breakpoint and repeat 1 to 3; the tab shows in the sheet.
  8. Mobile: on an iPad-width layout tap a remote subagent on a linked environment; it opens in the inspector, and Maximize fills the screen. On a phone it opens as its own screen.

Latest real run

Run for real after the rebase: a local subagent and a linked thread open as two tabs in the same panel, and the linked tab's body is now the same timeline as the subagent's (same prompt pill, "Worked for …" group, gutters), with the read-only bar where the composer would be.

The right panel with a subagent tab and a linked-thread tab; the linked thread uses the normal timeline with a read-only bar

Claude Fable 5.2, Claude Code in T3 Code

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 21.5 KiB — 24.4 KiB ✅
Codex Live turn messages — 1 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.9 KiB — 24.4 KiB ✅
Claude Live turn messages — 1 — 8 ✅

Other scenarios

No main baseline exists yet for these 64 scenario measurements.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded — 10.5 KiB — 12.7 KiB ✅
Codex short turn resume WebSocket messages — 2 — 2 ✅
Codex long turn running, cold open HTTP decoded — 281.7 KiB — 302.7 KiB ✅
Codex long turn running, cold open rows — 75 — 75 ✅
Codex long turn running, history page HTTP decoded — 92.4 KiB — 107.4 KiB ✅
Codex long turn running, history page rows — 75 — 75 ✅
Codex long turn finished, cold open HTTP decoded — 381.5 KiB — 410.2 KiB ✅
Codex long turn finished, cold open rows — 151 — 151 ✅
Codex long turn finished, socket cold open WebSocket decoded — 381.6 KiB — 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages — 2 — 2 ✅
Codex long turn finished, socket cold open rows — 151 — 151 ✅
Codex long turn finished, work page HTTP decoded — 186.2 KiB — 200.2 KiB ✅
Codex long turn finished, work page rows — 150 — 150 ✅
Codex idle thread resume WebSocket decoded — 65 B — 200 B ✅
Codex idle thread resume WebSocket messages — 1 — 1 ✅
Codex fleet shell snapshot HTTP decoded — 42.4 KiB — 53.7 KiB ✅
Codex fleet shell snapshot rows — 27 — 27 ✅
Codex fleet shell subscribe WebSocket decoded — 65 B — 200 B ✅
Codex fleet shell subscribe WebSocket messages — 1 — 1 ✅
Codex fleet shell resume check HTTP decoded — 18 B — 100 B ✅
Codex fleet shell resume check rows — 0 — 0 ✅
Codex stale shell reload HTTP decoded — 42.4 KiB — 53.7 KiB ✅
Codex stale shell reload rows — 27 — 27 ✅
Codex stale shell resume WebSocket decoded — 140 B — 400 B ✅
Codex stale shell resume WebSocket messages — 2 — 2 ✅
Codex stale todo list cold open HTTP decoded — 72.4 KiB — 83.0 KiB ✅
Codex stale todo list cold open rows — 75 — 75 ✅
Codex stale todo list cold open nodes — 2 — 4 ✅
Codex stale todo list cold open subagents — 2 — 4 ✅
Codex stale todo list cold open plans — 1 — 2 ✅
Codex stale todo list cold open providerTurns — 1 — 2 ✅
Codex stale todo list cold open checkpoints — 1 — 2 ✅
Claude short turn resume WebSocket decoded — 10.6 KiB — 12.7 KiB ✅
Claude short turn resume WebSocket messages — 2 — 2 ✅
Claude long turn running, cold open HTTP decoded — 283.3 KiB — 302.7 KiB ✅
Claude long turn running, cold open rows — 75 — 75 ✅
Claude long turn running, history page HTTP decoded — 93.4 KiB — 107.4 KiB ✅
Claude long turn running, history page rows — 75 — 75 ✅
Claude long turn finished, cold open HTTP decoded — 384.2 KiB — 410.2 KiB ✅
Claude long turn finished, cold open rows — 151 — 151 ✅
Claude long turn finished, socket cold open WebSocket decoded — 384.3 KiB — 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages — 2 — 2 ✅
Claude long turn finished, socket cold open rows — 151 — 151 ✅
Claude long turn finished, work page HTTP decoded — 188.1 KiB — 200.2 KiB ✅
Claude long turn finished, work page rows — 150 — 150 ✅
Claude idle thread resume WebSocket decoded — 66 B — 200 B ✅
Claude idle thread resume WebSocket messages — 1 — 1 ✅
Claude fleet shell snapshot HTTP decoded — 43.0 KiB — 53.7 KiB ✅
Claude fleet shell snapshot rows — 27 — 27 ✅
Claude fleet shell subscribe WebSocket decoded — 66 B — 200 B ✅
Claude fleet shell subscribe WebSocket messages — 1 — 1 ✅
Claude fleet shell resume check HTTP decoded — 18 B — 100 B ✅
Claude fleet shell resume check rows — 0 — 0 ✅
Claude stale shell reload HTTP decoded — 43.0 KiB — 53.7 KiB ✅
Claude stale shell reload rows — 27 — 27 ✅
Claude stale shell resume WebSocket decoded — 140 B — 400 B ✅
Claude stale shell resume WebSocket messages — 2 — 2 ✅
Claude stale todo list cold open HTTP decoded — 73.4 KiB — 83.0 KiB ✅
Claude stale todo list cold open rows — 75 — 75 ✅
Claude stale todo list cold open nodes — 2 — 4 ✅
Claude stale todo list cold open subagents — 2 — 4 ✅
Claude stale todo list cold open plans — 1 — 2 ✅
Claude stale todo list cold open providerTurns — 1 — 2 ✅
Claude stale todo list cold open checkpoints — 1 — 2 ✅

Baseline: unavailable · PR result: b8c5a20 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@juliusmarminge
juliusmarminge force-pushed the t3code/links/connect-to-interact branch from 22ba699 to eac3dc2 Compare November 20, 2026 05:36
@juliusmarminge
juliusmarminge force-pushed the t3code/links/unified-side-threads branch from 5b86cc2 to 6e11e5d Compare November 20, 2026 05:51
@juliusmarminge
juliusmarminge force-pushed the t3code/links/connect-to-interact branch from eac3dc2 to 79192bf Compare November 20, 2026 06:34
@juliusmarminge
juliusmarminge force-pushed the t3code/links/unified-side-threads branch from 6e11e5d to 97886cb Compare November 20, 2026 06:50
@juliusmarminge
juliusmarminge force-pushed the t3code/links/connect-to-interact branch from 79192bf to 091cf25 Compare November 20, 2026 07:07
juliusmarminge and others added 2 commits November 19, 2026 23:07
A plain click on a subagent, a side chat or a linked environment's read-only
thread opens it as a tab in the right panel. The modifier, a middle click and
the context menu open it on the main screen, and a client setting swaps the two.

The side-chat panel surface becomes a general thread surface, shown by one
pane with a shared header. A linked thread gets a read-only main-screen route.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…nd side chats

Where the layout has an inspector, a linked environment's read-only thread now
opens in it, with the same header as a subagent or side chat there, and its
maximize button gives it the whole screen. Phones keep the existing screen.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the t3code/links/unified-side-threads branch from 97886cb to b8c5a20 Compare November 20, 2026 07:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant