Agent pane: a fresh chat for a past chat shows its turns read-only (cx-5esm)
Summary
Opening a chat from the chats list sometimes starts a fresh agent chat: when the old chat can't resume here because its folder is gone, or acpmux plans a terminal or read-only open for it. That fresh chat now shows the original chat's past turns read-only, where the new chat's hero would be, until it has a session.
ChatsOpenCoordinatorputs the chat's index key on the seed (pastChat) for theterminal,readOnlyandneedsFolderroutes. Adopted chats replay their history as before.- When the page is ready, the model fills
handshake.pastTurnsfrom acpmux's_acpmux/chat_transcript(#19507), with a 2 s deadline. The key stays on the seed, so a reload before the first send shows the turns again. A daemon without the verb, or a chat it can't read, shows the normal empty chat. PastChat.tsxdraws each prompt as a bubble and each answer as Markdown, under "From the original chat (read-only)" in all 21 locales. It goes away once the chat has a session.
Most of this was built by op-next-toolbar (the cx-khns1 commits). I dropped the pure parser unit test and fixed up the work after a base merge and review.
Testing
Swift (AgentPanePastChatTests, at the model and route boundary):
- Red on 80a72bf, their test commit: the suite does not compile, because
pastChat,AgentPanePastTurnand the reader don't exist yet. - Green on 403828a: fleet
run-swift-testing-suites.sh Packages/macOS/CmuxNextpassed all 107 suites, includingAgentPanePastChatTests.
Other checks:
- Fleet
check-release-compile.shBUILD SUCCEEDED on 46c16f3 (Xcode 26.6). The merged head is compiled again before merge. - webviews:
bun run check(type-scale, layers, system-blue, vp check) andbun test test/ui-rules.test.tspass. - The god-file check (
--base) passes. The crash ratchet adds nothing. The two check-concurrency hits are on base, in files this PR doesn't touch. - A review subagent found nothing blocking. Its fixes are in 403828a: the label wording, the 2 s deadline and
aria-labelledby.
Changelog
Added: Opening a past chat that can't resume here shows its earlier turns, read-only, above the new chat.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Opening a chat that can't resume here now starts a fresh chat that shows the original chat's past turns read-only, where the new chat's hero would be, instead of an empty chat.
- The chat's index key rides on the seed (
pastChat), so a reload before the first send shows the turns again; adopted chats replay their history as before. - Turns come from the daemon's
_acpmux/chat_transcriptwith a 2 s deadline; a daemon without the verb or an unreadable chat shows the normal empty chat. - The turns render under "From the original chat (read-only)" in all 21 locales and disappear once the chat has a session.