cmux NEXT: the Inspector, the chat's right-hand panel
Summary
Every agent chat, Chief included, gets the Inspector: a panel at the right of the chat, opened by the last button at the top right of the header (as in Claude desktop). It replaces the Debug-only session rail and takes over its two orphaned follow-ups, #22327 (Changes card) and #22368 (Background tasks card). Both branches are merged in here.
Each section folds, top to bottom:
- Environment. The machine by its real name and icon: this Mac's name, an ssh peer, or a Cloud host, never "This computer". Then the folder, with its full path on hover, the GitHub repository, and the branch or worktree. Every row comes from the snapshot the page already has, so the section fills in one frame and nothing shifts. Save and a Remote Control switch show only when the App passes them in; nothing passes them yet (see Not in this PR).
- Context. Percent used with a small bar. Opened, it shows the tokens used and left.
- Connectors. "N connected · M to reconnect" for the MCP servers the harness loaded. Opened, it shows each server and its state.
- Changes. Every pull request the chat opened (
gh pr create) or touched: merge, close, edit, comment, review, ready, reopen, checkout orgh-merge-green, matched by URL,owner/repo#Nor-R owner/repo N. Rows are newest first. Each row has:- a state icon, the title and
repo #N; - +/- counts, with a hover breakdown into Code / Tests / Generated / Docs;
- "N failing (M already on base)", with the base part dimmed;
- an owner chip;
- a ⋯ menu: Open Beside Chat, Copy Link, Copy Reference.
- a state icon, the title and
- Servers. Running background commands that serve something (
bun/npm/pnpm/yarn dev|start|serve|preview,vite,next dev,rails s,uvicorn,http.server, …). Each row shows the ports its command names, and a port openslocalhost:Nbeside the chat. Ports the command doesn't name are never guessed. Each row has a Stop button. - Subagents. An avatar row (after ChatGPT's) with live counts such as "3 running · 40 done". Running ones come first and breathe gently, which reduced motion and the motion switch turn off. A click opens the list.
- Background tasks. Running commands, newest first, each with elapsed time and Stop, plus the wakeups the agent scheduled. Then "N finished", folded, which opens into each command with how long it ran and how it ended.
- Outputs. The files the chat wrote (each opens its diff), its artifacts (they open the chat's gallery), and the web links its replies gave. Pull request links appear under Changes instead.
Layout:
- It pushes the chat aside and the chat reflows. Settings > Appearance > Agent Chat > Inspector: Push / Overlay (
agentPane.display.inspector.placement, default Push) switches it. - It lies over the chat when the pane is too narrow to keep a 440 px chat beside it.
- The left edge drags to resize it, from 260 to 560 px. A double-click resets the width.
- Open/closed, width and folds are stored per viewer and hold in every chat tab until it's toggled off.
- Lists scroll inside their section. There are no "top N + Show more" caps.
Debug Settings agent.inspector (renamed from agent.sessionRail) is on by default. Off, the header has no toggle and the summary card comes back. While the Inspector is on, the summary card's button and panel are hidden, because the Inspector covers the same things.
It's called "Inspector" in code, Settings and strings. The existing ACP protocol inspector keeps its name ("ACP inspector"). The new string keys are chatInspector.* so they don't collide with its inspector.* keys.
Not in this PR
The page renders these as soon as the App supplies them; until then they're absent rather than faked:
- Remote Control and Save environment. There's no App action for either yet. Remote Control is relay policy and would be
risk:high. - Line counts, the kind breakdown, base-red counts and the owner for every PR. Today the App reads live status only for the chat folder's PR (the header chip), so that row gets its state and its failing-check count. A follow-up gives the App one batched
gh pr viewread for every PR in the list.
Testing
Ran on cosmic-gray (webviews only, no app build):
bun run checkinwebviews/: Oxlint, Oxfmt, type check, layer and type-scale checks all pass.scripts/web-lint.shpasses, andpython3 scripts/cmux-next/prepush-gate.pyreports no new violations.bun test test/chat-inspector.test.tsx: 11 pass. It covers:- opens by default;
- section order;
- the Environment rows (machine name, folder tooltip, branch);
- Context folding;
- Outputs opening a diff;
- the toggle remembering it's closed;
- state shared across panes, including another pane's
storageevent; - Cloud host;
- flag off;
- push vs overlay, by pane width and by setting;
- an output's diff split stepping it aside without remembering it closed;
- the Connectors counts;
- nine opened and touched PRs, all listed, newest first, including a merge in another repo;
- line counts, base reds and owner;
- close then reopen;
- the subagent avatar row with "+35" and expanding.
bun test test/chat-inspector-tasks.test.tsx: 8 pass. It covers the registry merge, server detection (ports named, no guesses, builds and tests excluded), the finished fold, servers with port and Stop, and a refused Stop.bun test test/tooltip-rules.test.ts test/ui-rules.test.ts test/gallery-coverage.test.ts: no findings in the files this PR changes. These suites have base findings in other files:pages/settings/*,pageKey.ts,EnvironmentPicker.tsx, Composer and others.
Not run here: Swift. The tunable rename, the header-state key and the Settings row compile only on the fleet, so CI covers them. The generated settings schema files aren't hand-edited; the autofix regenerates them.
Changelog
Added: Agent chats have an Inspector at the top right showing where the chat runs, its context, pull requests, servers, subagents, background tasks and outputs, with Push or Overlay in Settings.
Proof
Gallery entry agent-pane.chat-inspector has these variants: full, context-connectors-open, changes-breakdown, subagents-open, tasks-finished, cloud-empty, overlay. Before is the base's agent-pane.session-rail entry. Screenshots from the gallery advisory run follow in a comment.
Localization: 27 page strings and 4 Settings strings, each in all 21 locales. The three rail.* strings that are no longer used are removed.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Every agent chat, Chief included, gets the Inspector: a right-hand panel opened by the header's top-right toggle, replacing the Debug-only session rail. The Debug setting agent.inspector (renamed from agent.sessionRail) is on by default, and the panel folds in the Changes and Background tasks cards from #22327 and #22368.
The Inspector
- Eight folding sections: Environment (machine, folder, repo, branch), Context (percent and tokens), Connectors (MCP servers), Changes (PRs the chat opened or touched, with line counts, failing checks, owner), Servers (dev servers with named ports and Stop), Subagents (avatar row with live counts), Background tasks (running with elapsed time and Stop, finished folded), Outputs (files, artifacts, links). Context and Outputs hide until the chat has content for them.
- Opens as an overlay by default so it never reflows the chat; a Settings switch moves it to Push, pushing the chat aside. Width drags from 260 to 560 px, and open state, width, and folds persist across chat tabs. Lists scroll with no "Show more" cap.
- PR matching ignores quoted
--bodyor--titletext, so a PR name that appears only in a comment's text is not counted as touched.
Notes
- Off, the header has no toggle and the summary card returns; while on, the card's subagent, command, background, and started-chat counts open the Inspector's sections instead.
- Save and Remote Control render only when the App passes them in; live PR status is read only for the chat folder's PR, with batched reads for the rest as a follow-up.
- The merge with base restored #22724's New Tab repository folding, the Chief context Copy button, and Retry's model release labels.
- A release-note highlight is included with a "Try it" action that opens a new agent chat.