Repository navigation
A Claude chat shows the turns made outside it - #31615
Conversation
When a Claude chat's agent next opens, turns written to the same conversation elsewhere (claude --resume in a terminal) are appended once, in order, under the existing "Continued outside this chat." divider. Streamed reply and thinking rows are now keyed by their source block (message id and block index), which Claude also saves on each transcript row, so the chat can tell which saved rows it already shows. The read goes back from the end of the transcript only to the chat's saved turn-end leaf, replays the rows through Claude's own translator in an isolated sink, and commits them in one settlement that writes nothing if the chat moved. Imported prompts are display-only and never settle a send; any failure opens the chat normally.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3c75ab43-c5a6-4acc-b04f-8eb2912b4f26
📒 Files selected for processing: 12
src/main/claude/claude-streamed-block-identity.tssrc/main/claude/claude-structured-dispatch-test-support.tssrc/main/claude/claude-structured-journal-translation.test.tssrc/main/claude/claude-structured-options.test.tssrc/main/claude/claude-structured-session-acquisition.tssrc/main/claude/claude-structured-session-open.tssrc/main/claude/claude-structured-session-state.tssrc/main/claude/claude-transcript-catch-up.test.tssrc/main/claude/claude-transcript-catch-up.tssrc/main/claude/claude-transcript-import-plan.tssrc/main/claude/claude-transcript-tail.tssrc/main/native-chat/agent-session-journal/journal-legacy-import.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
The Codex catch-up's agent-neutral parts move to one module: the open-time envelope (its own deadline and cancellation, never gating the open), the bounded staged batch, the single settlement commit that re-checks the journal before writing, and the "Continued outside this chat." divider. Codex keeps only how it reads its saved turns and what the chat already holds. No behavior change; the other agents' catch-up builds on this instead of copying it.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
25c338e8-3f5e-480b-9a90-dceb66b0157d
📒 Files selected for processing: 3
src/main/claude/claude-transcript-catch-up.test.tssrc/main/claude/claude-transcript-import-plan.tssrc/main/claude/claude-transcript-tail.ts
🚧 Files skipped from review as they are similar to previous changes: 1
- src/main/claude/claude-transcript-catch-up.test.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.
…er' into brennanb2025/flip-claude-catchup
… when the agent asks
…ommit to be written A journal write barrier that never settled after the import was admitted held the provider's open past the catch-up deadline. The wait now ends with the deadline or the open's cancellation, like every other step.
…er' into brennanb2025/flip-claude-catchup
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Record rejected resolved-item admissions in… · claude-final-output-coverage.ts:22-48
src/main/claude/claude-final-output-coverage.ts:22-48
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRecord rejected resolved-item admissions in
createClaudeFinalOutputCoverage.When a live task settles,
writeClaudeBackgroundTaskRowcan receive abackpressurerejection fromtryAppendResolvedItemAndPublish.ClaudeBackgroundTaskRowWriterstores the row and retries it, but the retry result does not affectfinalOutputAdmitted. The resume-point writer checks onlyfinalOutputAdmitted, so it can persist a boundary past the unwritten task row. Wrap both resolved append methods at the coverage boundary.Suggested fix
const revise = target.tryReviseResolvedItem const reviseAndPublish = target.tryReviseResolvedItemAndPublish + const appendResolved = target.tryAppendResolvedItem + const appendResolvedAndPublish = target.tryAppendResolvedItemAndPublish const sink: StructuredAgentSessionEventSink = { ...target, + ...(appendResolved + ? { + tryAppendResolvedItem: (...args: Parameters<typeof appendResolved>) => { + const admission = appendResolved(...args) + return args[3].lifecycle ? record(admission) : admission + } + } + : {}), + ...(appendResolvedAndPublish + ? { + tryAppendResolvedItemAndPublish: ( + ...args: Parameters<typeof appendResolvedAndPublish> + ) => { + const admission = appendResolvedAndPublish(...args) + return args[3].lifecycle ? record(admission) : admission + } + } + : {}),
ℹ️ 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:
4fc372e9-32e2-4ab7-b058-8a79ce862da4
📒 Files selected for processing: 2
src/main/claude/claude-journal-translator-contract.tssrc/main/claude/claude-structured-journal-translation.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
|
Claude remembered terminal continuation in a saved conversation while Chat UI omitted those terminal turns. This PR imports the bounded missing suffix when Claude next starts, completes proved partial text/tool content in place, and uses source message clocks and completion endpoints for newly imported work. Reopening a tab alone does not launch Claude or import history. Display recovery never proves delivery or advances the saved resume point itself. Three general review rounds are complete. The final independent integration checks accepted Real lifecycle QA on Current pushed head QA carry: main merges Retained limits: existing bad imported timestamps/durations are preserved; append-only prompt placement and later additional dividers remain (STA-11349). Older paired clients may offer unsupported Rewind on an unknown follow-up; the host refuses before mutation. Pre-existing settled-row accessibility labels are tracked in STA-10926. The baseline-existing optional history-proof attachment-order observation is outside this PR; no refused message was observed, and pending-send recovery on that shape is not claimed passed. For Brennan's review Previous build and first import on
Two real replies/Read, later edited/queued batch, and no-content restart repeat: Carried Native phone saved-history rendering on775: Three code spots for judgment: bounded startup projection, source projection and ownership, unknown input membership. |












Problem and change
Continuing a saved Claude conversation in a terminal made Claude remember the new turns, but Orca’s Chat UI omitted them. The chat journal previously contained only output Orca had streamed itself.
When that chat next starts Claude, this PR adds missing terminal prompts, replies and tool results once, in source order. It completes proved partial reply/tool contents in the same saved item and records newly recovered message clocks and work durations from the source timestamps. Showing a tab alone does not start Claude or import history. This PR adds catch-up; enabling the chat/terminal switch is separate.
Behavior and limits
The common continuation/final-content pattern is retained. Showing terminal-only turns requires the additional bounded suffix projection. Repeated prompt-to-history association remains a disclosed population-dependent cost; the N/10N operation contract verifies the bound, not low latency. Imported prompts remain display-only; tracked alongside #30580. The shared runner in #31622 is already merged, so this change ships independently.
Verification
Three general review rounds completed, including independent source/reference, performance and readiness checks. The captured source-clock and duration regressions, saved queued-scope regression and real disk/SQLite repeat-operation contract remain intact. Conservative production accounting is 1,296/1,300, including historical shared work and the full timing correction; deletion or extraction gives no budget credit.
Actual lifecycle QA on
775ce209cdbb90a03e402d90655d193a2c9f95c7upgraded an authentic previous-build profile after real terminal continuation. It verified original rows/options and the saved resume point, exactly-once prompts/replies/Read results, source clocks and Worked1s/2s, two further real native replies, later edited/queued ancestry without the abandoned reply, and Worked2m31s/38s from genuine endpoints. A real graceful restart and no-content repeat preserved all 50 journal rows and 41 ordered history items. All owned processes and ports were clear afterward.The earlier real
aa8b6b35e443122c1420da7544864d14cf27654frun carries unchanged partial text/tool repair, valid Rewind, Claude Stop/recovery, Codex replies/tool/Stop/recovery and local RPC. This PR’s later timing correction changed none of those flows. Unknown membership is a captured-input contract, not a fabricated producer or runtime waiver. Existing tests cover unchanged transport, paging and reset consumers. No duplicate Windows matrix is required: no Windows/WSL process behavior changed, and lookup has encoder/selected-home/moved-project tests plus CI. No Windows runtime pass is claimed.Mobile has its renderer regression and CI. Its branch-only native screenshot now shows the shipping phone chat with expanded Worked2m31s/Bash activity, collapsed Worked38s, imported replies and an empty composer. It used the saved authentic775 history through supported pairing and normal workspace navigation, with no agents. Normal incremental Xcode simulator signing fixed the SecureStore setup failure, with unchanged JavaScript and no new credential or product-file change. All owned processes/device/listeners were cleaned and real-config hashes stayed unchanged. This proves saved-history rendering only; no extra functional-agent or unknown-membership runtime pass is claimed. Current pushed head is
3a396a27bb92199113d8ab11df934b6c29011c99. CI passed 25 checks with 16 skips, including all five Node24/Linux unit shards, static analysis/typecheck, mobile verification/bundle, wire compatibility and packages. Two inherited unit failures after the final main merge received test-only repairs: accept EPIPE on immediate socket closure, and isolate retained-slice heap measurement in bounded fresh Node children. The latter retains the real helper, original fixture sizes/limits/content assertions and explicit failing identity controls. Both exact named files passed locally through tc-gate, 12/12 tests. These repairs change no shipping code. The native screenshot is attached below.Main merge
585c66a344f30d530d1a8c80a56ff8de32382a23resolved a merge-blocking conflict with main7a5d0c02bd92785556402c9001665056875ca307; its eight manual resolutions change comments only. The test-only commitf83e86addd9a26b80dfdb3bb883f3bda6dfd409drepaired an inherited WebKit listener-cleanup race while retaining assertions. Final conflict-blocking main mergef3b1cc8672db39a06ed45bb8caf72bb57b1f72ffincludes mainb4fa75e954f1172c53abce3cbb323c17d03d401fand #32964. Its sole conflict was main's independent fix for that same test race; main's complete fix supersedes the duplicate branch repair. All owned production files remain byte-identical to the accepted implementation. Lifecycle QA carries across both merges and the test-only commit; CI validates the merged head.A later actual merge-blocking conflict required merge
fc57c73dae648623cae67c1278fc7786fe632e31with pinned mainb46be798ed4298a1b596e596adaccb79d081271b. Its two journal conflicts and all eight overlaps were incoming comment cleanup. Independent verification confirms all affected code, assertions, source clocks and immutable scopes remain unchanged. The accepted source/reference/performance conclusions and lifecycle QA carry; new-head CI remains the gate.Pre-existing settled text-only accessibility label mismatch is tracked in STA-10926 and reproduced on the authentic baseline. A separate baseline-identical optional provider-history proof rejects an attachment-before-parent ordering; no refused message was observed in the exercised startup/history/repeat flows. Pending-send recovery for that shape is not claimed passed. Both observations remain outside this PR.
Visual proof
Two normal native replies and a Read result after import:
Later batch and genuine queued follow-up within its parent turn:
Actual no-content restart repeat:
Carried unchanged-flow screenshots from
aa8b6b35: Claude and Codex Stop/recovery, final text/tool repair, and ordinary valid UI Rewind. These are historical flow captures; any older Worked values in them are not evidence for the corrected duration calculation. The775 images above show that correction.Native phone saved-history rendering on775; expanded and collapsed Worked turn bars:
Change accounting
Conservative production: 1,230 accepted lines plus all 66 timing-correction additions/deletions = 1,296 against the approved 1,300. Historical 1,232 is retained in the audit. Shared production145 and test/support198 remain charged. Current tree cancellation does not reset the budget. Test/support cumulative movement was 2,531 before the six-line CI repair, then 2,537; the final two-test CI repair adds 132 gross lines, bringing cumulative test/support movement to 2,669. The fixture move is fully counted. The test-value audit retained all three consequential regression signals and confirmed fixture reuse. No file-limit exception, scanner, workflow or extra CI job was added.
Author: @BrennanKB5