cmux agents snapshot: report GUI agent chat tabs as chats, not about:blank browsers
cmux agents snapshot showed every GUI agent chat tab as an about:blank browser.
Cause. The CLI's daemon connection doesn't negotiate conversation-tabs-v1. The daemon therefore downgrades each chat tab to a browser tab and lists a stand-in browser for it at about:blank (conversation_tabs_store.rs downgrade_conversation_tabs). compose_snapshot kept that downgraded copy even though the app topology it merges already reports the tab as kind: "conversation" with its agent_session.
Effect: a launcher (Chief subagent) read the snapshot and found no chat in the workspace it had just made. It then started a second chat there, so the same task ended up with duplicate chats (seen with https://github.com/manaflow-ai/cmux/issues/27859). Related: https://github.com/manaflow-ai/cmux/issues/27879.
Fix. compose_snapshot walks the app topology for conversation tabs that have an agent_session. For each one:
- it marks the daemon's copy of the tab
content_kind: "conversation"and adds theagent_session; - it drops the stand-in browser, matched by the tab's
content_idor by the browser'stab_id.
Real browsers and page tabs are left alone.
This PR does not cover the other half of the "chat not found" symptom in the Chief agents group. That half is the app routing named-Chief-home sessions, already fixed by https://github.com/manaflow-ai/cmux/pull/27712 (0b675daf24ee) on this branch; NIGHTLY builds before that commit still show it.
Regression test
./scripts/verify-cmux-tui-hosted.sh --filter snapshot_ runs snapshot_shows_agent_chat_tabs_the_daemon_lists_as_browsers in cli/agents/tests.rs.
- Red, test-only commit 54bec3af7720 (branch
next-chief-launcher-chat-tab-red): pending - Green, head c0366ef63a7e: pending
Review
A correctness review subagent returned SHIP with no bugs. It raised two low nits, both fixed in c0366ef63a7e:
- rustfmt the signature;
- also drop a stand-in browser by
tab_id.
It also noted that cmux agents events still emits no chat-state events for these tabs, because the snapshot tab has no agent_state. That was true before this change too; it is left as a follow-up.
Observed / Not run
- Observed: on the user's NIGHTLY (c230bb58a50c), the app's
snapshot.getreports these tabs askind: "conversation", while the daemon lists them asbrowserat about:blank. Hosted red/green results are above. - Not run: no tagged GUI dogfood of the CLI output. This change only touches CLI JSON composition, which the unit test covers.
Changelog
- Fixed:
cmux agents snapshotlists GUI agent chat tabs as chats with their session instead of blank browser tabs.
🤖 Generated with Claude Code