Repository navigation
Keep chat thinking before its answer across history loads - #33628
Conversation
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
91c1169b-e6a0-48d1-9318-1b599fdacde4
Files selected for processing: 32-
mobile/src/session/mobile-native-chat-stream-frame.test.tsmobile/src/session/use-mobile-native-chat-session.test.tsmobile/src/session/use-mobile-native-chat-session.tssrc/main/ipc/native-chat-subscribe-lifecycle.test.tssrc/main/ipc/native-chat.test.tssrc/main/ipc/native-chat.tssrc/main/native-chat/transcript-file-order.test.tssrc/main/native-chat/transcript-file-order.tssrc/main/native-chat/transcript-incremental-reader.tssrc/main/native-chat/transcript-reader.tssrc/main/native-chat/transcript-stream-lines.tssrc/main/native-chat/transcript-tail-reader.tssrc/main/native-chat/transcript-watch-contract.tssrc/main/native-chat/transcript-watch-engine.tssrc/main/runtime/rpc/methods/native-chat-ssh-transcript.test.tssrc/main/runtime/rpc/methods/native-chat.tssrc/renderer/src/components/native-chat/NativeChatMessageList.queued-turn-order.test.tsxsrc/renderer/src/components/native-chat/native-chat-incremental-assembler.test.tssrc/renderer/src/components/native-chat/native-chat-incremental-assembler.tssrc/renderer/src/components/native-chat/native-chat-message-grouping.tssrc/renderer/src/components/native-chat/native-chat-message-list-projection.tssrc/renderer/src/components/native-chat/native-chat-sent-prompt-history.tssrc/renderer/src/components/native-chat/native-chat-session-assembler.tssrc/renderer/src/components/native-chat/native-chat-session-transport.test.tssrc/renderer/src/components/native-chat/native-chat-session-transport.tssrc/renderer/src/components/native-chat/use-native-chat-live-session.test.tssrc/renderer/src/web/preload-api/web-native-chat-api.tssrc/renderer/src/web/web-preload-api-runtime-calls.test.tssrc/shared/native-chat-transcript-projection.test.tssrc/shared/native-chat-transcript-projection.tssrc/shared/native-chat-types.tssrc/shared/rpc-contract/native-chat-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
|
An answer could appear above its own thinking when transcript rows shared a timestamp. Timestamp adjustment also made row order depend on how much history had loaded. The chat now follows stable transcript positions, keeping thinking before its answer as older history loads and new messages arrive. Pasted images remain attached to their prompt, and command feedback and pending messages retain their placement. Older clients and servers keep their existing representation. The full review completed two adversarial rounds, an independent architecture challenge, compatibility and performance checks, and a final comparison with the common pattern. It resolved pagination/append ordering, fabricated-clock status effects and equal-time image pairing. CI follow-ups repaired test-project admission, stale capability expectations and synchronization with the real watcher; shipped code stayed unchanged. No open P0/P1 or newly accepted worse behavior remains. Intended adaptations of the common pattern use byte positions for externally owned files, preserve terminal supplements and historical image pairing, and retain the old representation for clients without the capability. Existing phone prompt-first image normalization and unmatched-image lookahead limitations are outside this change. Verified: actual reader/watcher → 300-to-500 older history → original watcher row501, renderer thinking-before-answer, image page/append pairing, actual RPC old/new read and stream representations, real phone frame/fold consumption and bounded N/10N append-decision work. Focused root and mobile contracts passed; strict bridge accounting covered 795 recordings with 0 unclassified. CI is green on reviewed head A hidden branch-only Electron screenshot check used deterministic transcript fixtures, without agent execution. It verified the actual transcript screen with expanded thinking above the answer and one appended image prompt/attachment chip. Image preview pixels, live provider replies, lifecycle/login and remote performance were not exercised; the changed flows are in the UI tests row. Screenshot evidence is from 3db8c40. Later commits d6f97ac, bdd54fd, 7fa1011, cff603b and 916dbf8 touch only non-shipped tests/recordings/test-runner configuration; the screen and runtime code remain identical. Final reviewed head: 916dbf8. For Brennan’s review: |



ELI5
A chat answer could appear above its own thinking when several transcript records had the same timestamp. The conversation now follows the transcript's actual order, including when older history loads while new replies arrive.
What Changed
File-backed chat rows use their existing position in the transcript as their display order. Their timestamps keep their original meaning. Thinking stays before its answer, pasted images remain attached to the right prompt, and command feedback and optimistic messages keep their normal placement.
Desktop, web and phone reads and subscriptions agree on the representation. Older clients and servers retain their existing path; this adds no saved ordering field, minimum server version or RPC operation.
Why
A row needs the same position whether it came from a full read, a recent window, an older page or a live append. Adjusting timestamps depended on how much history had been read and could also make old content look newer to status logic. Source positions supply that stable order without reading the missing prefix or changing the transcript file.
Plan: one change covering the reader, shared projection, image folding, incremental assembly and compatible transport selection. Ordering and the mixed-version read contract take the full review path.
Linked Issue
Tracked in STA-11667. Supersedes #31794, which remains open for maintainer disposition.
Visual Proof
Branch-only hidden Electron screenshots use deterministic transcript fixtures, with no agent execution. Thinking stays above the final answer, and an appended pasted image remains one prompt with an attachment chip.
Testing
CI is green on reviewed head
916dbf83f0a25d011e0ccf3ac6df7050d2380c83: all five root shards, static analysis/typechecking, mobile verification, macOS/Linux/Windows transcript readers, persistence, relay integration, packaging and three WSL distro checks passed. PR Checks and Mobile verify.Targeted contracts exercise the actual file reader and watcher, 300→500 older-history expansion followed by row501 from the original watcher, final reasoning/answer rendering, image boundaries, mixed sources, old/new transport representations, and bounded N/10N incremental work. The real reader-to-phone stream/fold contract runs in the root suite without requiring the mobile app's dependency tree. The two affected root suites passed 14/14; the five affected mobile suites passed 810 distinct cases, including strict bridge accounting for 795 recordings with 0 unclassified. The normal pre-commit hooks passed. Four existing mobile recordings now expect the negotiated capability; their replies, checkpoints and visible outcomes are unchanged. Most JSON churn comes from moving blocks in the existing sorted content-addressed pool.
The hidden branch screenshot check verified thinking above its answer and one appended image prompt/attachment chip. It used deterministic transcript fixtures, without live agent execution or an image-preview-pixels claim.
Review
The full review completed two adversarial rounds, an independent architecture challenge, compatibility and performance passes, and a final comparison with the common pattern. Later CI repairs changed only tests, recordings and their runner; all 20 production files remain identical to the independently reviewed implementation. The earlier screenshot evidence carries across those non-shipped commits.
Agent skill upstream boundary
Notes
Intended adaptations of the common pattern: external transcript files use byte positions instead of saved sequence fields; terminal supplements keep their existing placement; historical image rows fold into one prompt; mixed-version clients retain the original representation when the capability is absent.
No provider login, process lifecycle, saved transcript or journal migration changes. The native chat UI QA row applies: renderer/contract tests and a quick branch screenshot, without a real-agent QA round.
Checklist