Skip to content

A Claude chat shows the turns made outside it - #31615

Merged
brennanb2025 merged 37 commits into
mainfrom
brennanb2025/flip-claude-catchup
Oct 24, 2026
Merged

brennanb2025 merged 37 commits into
mainfrom
brennanb2025/flip-claude-catchup

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1627 $\color{#cf222e}{\Huge{\mathbf{−}}}$​79 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1548
Prod 37 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1247 $\color{#cf222e}{\Huge{\mathbf{−}}}$​103 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1144

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

  • Recovery reads backward to the saved completed-turn boundary, with a 16 MiB limit and the existing 30-second asynchronous startup budget. Missing, oversized or cancelled reads are skipped so startup can continue. This is optional startup work, with a disclosed latency cost.
  • One conditional journal batch adds or completes content only while the relevant saved identities and progress still match. Existing placement, creation times, options and Interrupted outcomes remain intact. Recovery never proves delivery, retries a send or advances the saved resume point by itself.
  • A queued terminal follow-up stays in its proved enclosing turn. Unknown membership remains visible without an invented turn, timer, completion or independent Rewind boundary. Normal valid Rewind and later sends retain their paths.
  • New recovered durations exclude idle time after completion. Without endpoint evidence, numeric duration is omitted. Previously imported wrong clocks/durations are preserved.
  • Intended compatibility limit: an older paired client can offer Rewind on an unresolved follow-up; the host refuses that unsupported cut before changing state. Older clients may also ignore the optional source clock. Other content and actions remain available.
  • Append-only recovery can place a newly admitted prompt before older recovered content. Later outside batches can add another divider, tracked in STA-11349. An earlier-build interrupted reply with old item keys can appear twice on its first catch-up.

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 775ce209cdbb90a03e402d90655d193a2c9f95c7 upgraded 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 aa8b6b35e443122c1420da7544864d14cf27654f run 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 585c66a344f30d530d1a8c80a56ff8de32382a23 resolved a merge-blocking conflict with main 7a5d0c02bd92785556402c9001665056875ca307; its eight manual resolutions change comments only. The test-only commit f83e86addd9a26b80dfdb3bb883f3bda6dfd409d repaired an inherited WebKit listener-cleanup race while retaining assertions. Final conflict-blocking main merge f3b1cc8672db39a06ed45bb8caf72bb57b1f72ff includes main b4fa75e954f1172c53abce3cbb323c17d03d401f and #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 fc57c73dae648623cae67c1278fc7786fe632e31 with pinned main b46be798ed4298a1b596e596adaccb79d081271b. 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

Previous build: remembers terminal word, omits outside turns Branch: imports the outside turns once
Baseline Catch-up

Two normal native replies and a Read result after import:

Native replies and Read

Later batch and genuine queued follow-up within its parent turn:

Later catch-up

Actual no-content restart repeat:

Unchanged 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.

final-claude-after-recovery.png
final-codex-short-after.png
final-text-after-repair.png
final-tool-result-detail.png
final-claude-valid-rewind.png
final-codex-valid-rewind.png

Native phone saved-history rendering on775; expanded and collapsed Worked turn bars:

Native phone saved history

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

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.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 21, 2026 18:56
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

ℹ️ Recent 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: 6662affd-4370-4012-a329-8552a8dab3e7
📥 Commits

Reviewing files that changed from the base of the PR and between 04473ae and 0dae3c4.

📒 Files selected for processing: 1
  • src/main/claude/claude-journal-translator-contract.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/main/claude/claude-journal-translator-contract.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

Claude streamed blocks now use transcript-stable identities when message IDs are available. Resumed sessions can read and reconcile transcript rows after a saved leaf, and resume-point writes check transcript coverage, output admission, turn state, and journal writes. Unknown turn scope is retained through native-chat membership and display logic, and it no longer anchors turn assignment or qualifies for rewind or latest-request lookup.

Priority: Normal

Merge Risk: Minimal · up to 0dae3

The previously identified catch-up delays and missing tool-result risk are addressed. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 56.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 51 functions across 52 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main user-facing change: Claude chats now show turns made outside the chat.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is comprehensive and explains the problem, behavior, scope, testing, visual proof, compatibility limits, and validation results. It does not follow every template heading exactly and d…
Full details: Description check

Explanation

The description is comprehensive and explains the problem, behavior, scope, testing, visual proof, compatibility limits, and validation results. It does not follow every template heading exactly and does not include an explicit Fixes #... entry, but the required context is largely present.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3c75ab43-c5a6-4acc-b04f-8eb2912b4f26
📥 Commits

Reviewing files that changed from the base of the PR and between 3b02945 and c08b1ba.

📒 Files selected for processing: 12
  • src/main/claude/claude-streamed-block-identity.ts
  • src/main/claude/claude-structured-dispatch-test-support.ts
  • src/main/claude/claude-structured-journal-translation.test.ts
  • src/main/claude/claude-structured-options.test.ts
  • src/main/claude/claude-structured-session-acquisition.ts
  • src/main/claude/claude-structured-session-open.ts
  • src/main/claude/claude-structured-session-state.ts
  • src/main/claude/claude-transcript-catch-up.test.ts
  • src/main/claude/claude-transcript-catch-up.ts
  • src/main/claude/claude-transcript-import-plan.ts
  • src/main/claude/claude-transcript-tail.ts
  • src/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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 25c338e8-3f5e-480b-9a90-dceb66b0157d
📥 Commits

Reviewing files that changed from the base of the PR and between c08b1ba and 4c558d0.

📒 Files selected for processing: 3
  • src/main/claude/claude-transcript-catch-up.test.ts
  • src/main/claude/claude-transcript-import-plan.ts
  • src/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.

@brennanb2025
brennanb2025 changed the base branch from main to brennanb2025/catchup-shared-runner October 21, 2026 19:24
…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.
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/catchup-shared-runner to main October 22, 2026 08:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 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 win

Record rejected resolved-item admissions in createClaudeFinalOutputCoverage.

When a live task settles, writeClaudeBackgroundTaskRow can receive a backpressure rejection from tryAppendResolvedItemAndPublish. ClaudeBackgroundTaskRowWriter stores the row and retries it, but the retry result does not affect finalOutputAdmitted. The resume-point writer checks only finalOutputAdmitted, 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
📥 Commits

Reviewing files that changed from the base of the PR and between 618f17d and 04473ae.

📒 Files selected for processing: 2
  • src/main/claude/claude-journal-translator-contract.ts
  • src/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.

@brennanb2025

brennanb2025 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

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 fc57c73dae648623cae67c1278fc7786fe632e31: the last main merge resolved comment-only journal conflicts and preserved code, assertions, source clocks, saved rows and unknown-input scopes. The retained checker also accepted the two-test-only correction at 3a396a27bb92199113d8ab11df934b6c29011c99; all other blobs are identical. Source/reference/performance conclusions carry. Conservative production remains 1,296/1,300; the repeated prompt/history scan remains disclosed P2 and the operation contract is not a latency guarantee.

Real lifecycle QA on 775ce209cdbb90a03e402d90655d193a2c9f95c7 passed authentic previous-build upgrade, initial and later catch-up, real edited/queued ancestry, two native Claude replies and Read, corrected source clocks/Worked durations, and graceful restart/no-content repeat with all 50 rows and 41 items unchanged. The unchanged earlier aa8b6b35 repair, ordinary Rewind, Claude Stop/recovery, Codex replies, tools, short Stop and recovery and localRPC flows carry. Codex shortStop completed before a tool began; this is not persistent-command termination proof. No duplicate Windows matrix is required because Windows/WSL process behavior did not change. Unknown membership is captured-input coverage, not a fabricated runtime producer.

Current pushed head 3a396a27bb92199113d8ab11df934b6c29011c99 passed all 25 checks, with 16 skips, including all five Node24/Linux unit shards, static analysis/typecheck, mobile verification/bundle and wire compatibility. The two inherited unit failures received test-only repairs: accept EPIPE on immediate socket closure; isolate heap measurement in bounded Node children while preserving the actual helper, original fixture sizes/limits and explicit failing identity controls. Both named files passed locally, 12/12 tests. No shipping code changed. The required native screenshot now shows the shipping phone chat using the authentic saved775 history: expanded Worked2m31s/Bash activity, collapsed Worked38s, imported replies and an empty composer. It reached that screen by supported pairing and saved-workspace navigation, without agents. Normal incremental Xcode simulator signing fixed the setup entitlement failure; JavaScript is unchanged and no product file or new credential changed. Cleanup verified no owned survivors/listeners/device and unchanged real-config hashes. This is rendering proof only, not another functional-agent run or unknown-membership runtime proof. The bounded independent evidence audit accepted this screenshot requirement.

QA carry: main merges 585c66a344f30d530d1a8c80a56ff8de32382a23, f3b1cc8672db39a06ed45bb8caf72bb57b1f72ff and fc57c73dae648623cae67c1278fc7786fe632e31 preserve the accepted owned implementation; fc57 overlaps are comment-only. Test-only f83e86addd9a26b80dfdb3bb883f3bda6dfd409d repaired a listener test, then main supplied its complete equivalent. Test-only 3a396a27bb92199113d8ab11df934b6c29011c99 repairs the two inherited unit oracles described above. Independent delta checks accepted their preservation. The real775 lifecycle results and unchangedaa8 flows carry across these merges/non-shipped commits; current-head CI is the merged-source gate.

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 775ce209:

Previous build Catch-up
Baseline Catch-up

Two real replies/Read, later edited/queued batch, and no-content restart repeat:

Native replies and Read
Later queued batch
Repeat

Carried aa8b6b35 captures of unchanged flows below: Claude/Codex Stop→recovery, text/tool repair, ordinary valid Claude/Codex UI Rewind. Historical Worked values are not corrected-duration proof; use the 775ce209 captures above.

final-claude-after-recovery.png
final-codex-short-after.png
final-text-after-repair.png
final-tool-result-detail.png
final-claude-valid-rewind.png
final-codex-valid-rewind.png

Native phone saved-history rendering on775:

Native phone saved history

Three code spots for judgment: bounded startup projection, source projection and ownership, unknown input membership.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant