Repository navigation
fix(transcript): keep system rows inside the live-turn walk - #1979
Conversation
A system update can land during a tool call and render after the running turn's rows, so a system-row tail must not end the walk the way an ordinary prompt does - the turn would fall back to the settled phase, which is the vastsa#1949 symptom with a different tail. System rows now stay inside the run like steering messages; an ordinary user message remains the boundary. modelSystem rows never reach the walk either way, because isVisibleMessage filters them from the projected entries; a fixture pins that. The ChatTranscript comment and the component spec now match the walk.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the changes to live-turn handling around system rows.
No open issues 🎉
What changed in this PR
Follow-up to #1976 addressing another case of #1949: a visible system row after a streaming turn should not make its header appear settled or trigger automatic collapse.
Changes:
- Skip system rows when locating the live history turn, while preserving ordinary user messages as run boundaries.
- Add regression coverage for visible system-row tails and filtered
modelSystemmessages. - Align the English and Chinese component specs with the updated liveness rule.
| File | Description |
|---|---|
docs/zh-CN/spec/04-ux/08-component-spec.md |
Updates the Chinese specification for system rows within a live run. |
docs/spec/04-ux/08-component-spec.md |
Documents the revised live-turn boundary rule. |
apps/desktop/test/turn-process.test.mjs |
Adds system-row and hidden-message regression cases. |
apps/desktop/src/lib/turn-process.ts |
Keeps system rows inside the live-turn backward scan. |
Review effort: Balanced
vastsa
left a comment
There was a problem hiding this comment.
Independently confirmed the visible-system-tail failure using the real production transcript projection and TranscriptHistory SSR: current main returns no live turn for a streaming tool followed by a system message; this head renders Running, open and active. All 29 targeted turn-process/transcript-live-turn tests pass, including ordinary-user crash boundaries and hidden modelSystem rows. The production diff is narrowly scoped to the boundary walk; no persistence or protocol changes. Candidate shared/i18n were rebuilt and reused dependency imports temporarily routed to those artifacts; diagnostic edits were restored. Diff check passes. All six remote checks pass. Latest main is an ancestor and PR merge candidate has the identical tested tree 947be1cad3fbef8792bf1db43d01594bd85180a5. Local coverage is real component SSR, not interactive Electron; remote Electron/Windows checks passed. Approved for merge.
Follow-up to #1976, deciding the case @muzimu217 raised in its review.
#1976 merged seven seconds after approval, before the commit answering that review could land. This is that commit, rebased onto current
main(everything else from #1976 is already in).Problem
liveHistoryTurnId()breaks on any non-steering user or system message. A system update can land during a tool call and render after the running turn's rows; with a system row as the tail, the walk stops before reaching the turn and the header falls back to the settled phase — the #1949 symptom with a different tail.modelSystemrows never reach the walk either way:isVisibleMessagefilters them from the projected entries entirely. The case that needed deciding is the visible system row.Change
collectLiveDelegationEntries(which breaks at system rows) — that helper answers a different question and keeps its own rule.ChatTranscriptcomment and the component spec (en + zh-CN) now match the walk.modelSystemrow produces no entry and does not affect selection; the crashed-turn-behind-an-ordinary-prompt boundary case is unchanged.Validation
node --test test/turn-process.test.mjs test/transcript-live-turn.test.mjs: 29/29 pass.pnpm --filter @pi-desktop/desktop typecheck,pnpm lint:biome: pass.E2E-TRANSCRIPT-live-turn-not-tail-stays-running(Draft).