fix(claude): show the same three rows around a compaction, live and reopened
A `/compact` produced two different pictures. Live: the prompt the user typed, then the divider. Reopened: the divider, then the continuation summary. Each view was missing exactly what the other had. The prompt was missing from history because a client-side slash command drives no model turn, so `pending_command_verdict` drops it — right for `/model`, wrong for the one command that leaves a mark of its own. It can't simply be emitted where the CLI wrote it, either: the local-command echo is written when the command FINISHES, so the record order is boundary, continuation summary, `<command-name>/compact`, and keeping file order prints the request below its own answer. The parser now holds the divider's index open and inserts the prompt there, which also keeps `/compact <instructions>` intact. Measured on a 19,435-line transcript that a resume replayed six times over: 7 dividers, 7 prompts. The summary was missing live because the persisted-tail strip removes everything after the last persisted user turn — correct for the reply being streamed, which the live stream re-shows, but a `system` turn has no live counterpart at all. Claude writes the continuation summary as one, and an AUTOMATIC compaction lands it mid-turn, so it stayed hidden for the whole rest of the turn and then appeared out of nowhere on reopen. System turns now survive the strip. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
X
xintaofei committed
ad7af8c4b5aba656c74f1b2895ca698679ee7715
Parent: 883a292