Repository navigation
fix(claude): resume a native chat from its real latest message - #22395
Conversation
Claude's last-prompt marker names the chain tip, which is often a stop-hook summary or attachment row that --resume-session-at rejects. The branch proof now resolves the marker to the latest main-chain message, and a plain resume re-derives its point from the transcript instead of trusting the stored cursor, resuming by session id alone when the transcript cannot vouch for one. An acquisition release now reads the transcript tail like close and exit do. Co-Authored-By: Claude <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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:
📝 WalkthroughWalkthroughCompleted Claude turns now update the durable provider-handle leaf in place. Claude launches resume by session ID without a leaf cursor, while close and exit persist the last completed-turn leaf. Transcript history proof now targets the last main-chain row. Claude rewind acquisition is removed, and pending Claude rewind records are settled as unsupported during reattachment. Priority: ➖ Normal Merge Risk: 🔵 Low · up to Restarted chats continue the provider conversation without replaying the prompt. Correct the comment before merging so it does not mislead future changes to resume behavior. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description is detailed and covers the user impact, mechanism, rationale, testing, visual proof, compatibility, and known gaps. However, the required Linked Issue section is incomplete because it contains only "Fixes #", and the checklist claims full lint, typecheck, test, and build success while the testing section reports only targeted suites and partial checks. Resolution Add the valid issue number to the Linked Issue section. Reconcile the checklist with the actual verification results by either running and reporting pnpm lint, pnpm typecheck, pnpm test, and pnpm build, or marking those checks as CI-covered and documenting the exceptions.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — minor suggestions inline.
Reviewed changes
- Transcript leaf is now a message —
claude-transcript-branch-graph.tsresolves Claude'slast-promptmarker to the latest main-chain user/assistant message (messageAtOrAbove) instead of accepting a hook-summary/attachment tip. - A plain reopen re-derives its resume point — new
rederiveClaudeResumePointreads the transcript (readClaudeTranscriptLeafWithReproof) and rewrites--resume-session-atbefore spawn; a failure falls back to resuming by session id. Skipped for requested rewinds and their recovery. - Acquisition release reads the transcript —
readTranscriptLeafis now threaded throughreleaseClaudeAcquisition, so a release persists a transcript-derived cursor rather than only the in-memory one. - Tests — new
claude-structured-resume-point.test.ts(13 cases) plus three updated existing suites for the extra read.
Verified locally: pnpm tc:node and oxlint clean; all src/main/claude and session-file-resolver tests pass except four process-exit-proof failures in claude-agent-sdk-exit-proof / claude-stream-json-connection that are unrelated to this diff.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
A completed turn now writes the live main-chain message uuid onto the owner's head provider-handle link in place, so a host that dies before its close path runs still resumes from its last completed turn and the chain does not grow per turn. The write is serialized per session, only logged on failure, and close and exit persist after it settles. Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Durable resume point advances at every turn end — new
persistClaudeTurnResumePointschedules a serialized write of the live leaf whenever aresultframe arrives; writes chain on the prior one, and a failure only logs, so a turn is never failed or held up. - Head provider-handle link is revised in place — new
reviseAgentSessionClaudeResumePointmoves the head link'sleafUuidandobservedAtwithout appending, so the chain does not grow per turn. It refuses a stale fence, a non-live lease, and a head minted by another owner or for another provider session, and re-validates the revised chain. - Close and exit wait for the in-flight turn-end write —
finalizeClaudePublishedSessionandpersistClaudeSessionHandlenowawait session.resumePointWrite?.settledbefore persisting their transcript-derived cursor, so the close/exit cursor lands last (acquisition release reuses the close path). - Tests — new
claude-structured-turn-resume-point.test.ts(4 cases) covering in-place advance without chain growth, crash recovery via the real launch resolver, close-write ordering, and failed-write tolerance, plusreviseAgentSessionClaudeResumePointcases and the integration test's live-head assertion updated.
I re-ran the new and touched suites (claude-structured-turn-resume-point, claude-structured-resume-point, agent-session-provider-handle-transition, claude-structured-session-integration, claude-structured-session-recovery, claude-structured-rewind, claude-structured-session-adapter): 91 tests pass. tsc -p config/tsconfig.node.json --noEmit is clean. I also traced every reader of providerHandleChain / provenHandleLinkId / identity.providerHandle in src/main for the in-place head revision: none compares a captured handle against the live head or treats the head leaf as a durable anchor, and renewAgentSessionLease does not bump runtimeFence, so the write's session.fence check stays valid for a live owner.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…after exit A turn-end write that failed was never retried when the next turn ended at the same point, because the memo of the last attempted leaf outlived the failure. A result frame delivered after the child's exit could also start a write that landed behind the exit path's transcript-derived cursor, moving the durable point backwards. The failed leaf is now forgotten so the next turn end retries it, and a turn-end write only runs while the session is still the published live owner. The session-id fallback on a plain reopen and a failed durable write on the unexpected-exit path now log why, instead of leaving no trail.
There was a problem hiding this comment.
✅ No new issues found in this delta.
Reviewed changes
- Turn-end write retries after a failure —
persistClaudeTurnResumePoint's rejection handler now clearssession.resumePointWritewhen it still points at the failed write, so the nextresultframe retries even when the leaf has not moved. - A result trailing the child exit no longer writes — the acquisition message path gates the turn-end write on
sessions.get(sessionId) === liveSession;handleExitdeletes that entry synchronously, so a lateresultcannot land behind the exit path's transcript-derived cursor. - Failure logging replaces silent drops — the transcript fallback now logs the stored cursor and the reason it could not be vouched for, and the unexpected-exit durable-write failure is logged instead of swallowed.
- Tests — retry-on-unmoved-leaf, late-result-after-exit, exit-write-failure logging, and the fallback diagnostic are pinned;
claude-structured-turn-resume-point,claude-structured-resume-point, andclaude-structured-session-adapterpass (57 tests).
I traced the new guard and retry against the close and exit paths: close sets closeFinalization before awaiting resumePointWrite?.settled, so no new turn-end write can be scheduled mid-close, and the failed-write clear is conditional on still being the current write, so a newer in-flight write is never clobbered.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Electron QA for the native Claude chat resume point. Worktree Renderer ownership, checked on every attach: The chat was the structured lane in a folder workspace ( A. Two turnsSent B. Durable point after those turnsStore:
Transcript: C. SIGKILL, then reopenThe dev runner process group was SIGKILL'd. CDP 9334 and the renderer port were gone. After relaunch on the same profile, the Claude Chat tab was restored with both earlier rows visible. Sent Head leaf after that turn: Startup log before the question: transcript branch proof failed ( D. Stale leaf set to the first user messageThe store has no checksum, so the edit was possible. With the app down, the head link's Sent The rendered history still showed BRAVO and the earlier After the turn, head leaf E. Stored point is a system rowThe transcript has system rows with subtype Startup log: the same sibling-branch proof failure, then resume by session id with storedLeafUuid Sent the same list prompt. Reply verbatim: Head leaf after the turn: Not verified
|
…laude's marker A plain reopen now passes only the session id, so Claude continues from the real end of its own conversation. Orca's saved leaf is its own record of the last completed turn, taken from the live stream at each turn end. It is bookkeeping (the reconciliation anchor), never a resume argument. - Launch resolution resumes by id and checks only the session id; the prior head leaf is carried into the publication link. - Remove the launch-time transcript re-derivation. - Close, unexpected exit, and acquisition release no longer read the transcript. They wait for any in-flight turn-end write, then persist the last completed turn, so a crash mid-turn never saves a half-turn prompt. - The delivery-reconciliation window walks from the file's last main-chain transcript row to the anchor instead of Claude's lagging marker, so a prompt Claude saved just before a crash reconciles as accepted. - Revert the transcript branch graph to main; the terminal handoff readers keep their semantics. - Report Claude rewind as unsupported. Its marker-based proof can never pass on the real binary, and no app screen calls it. Remove the Claude rewind launch, proof, and recovery path. A pending Claude rewind left by an older build is settled as refused on the next attach, which resumes by id; a failed settlement is logged and never blocks the chat.
There was a problem hiding this comment.
ℹ️ No critical issues — minor description/cleanup suggestions below.
Reviewed changes
- Resume by session id only —
--resume-session-atandresumeDropsTurnare gone; a resumed Claude launch passesresumealone and the stored leaf is bookkeeping (resumeLeafUuid). The durable-identity guard now compares only the provider session id, so a leaf that moved no longer blocks a launch. - Claude rewind removed — the rewind proof stack (
ClaudeRewindAttempt,claudeRewindAcquisitionProofs,replaceClaudeRewindOwner,readClaudeTranscriptLeafWithReproof) is deleted;rewindSupportreports unsupported, and a pendingprepared/provider-succeededClaude rewind is settled refused on attach. - History window tips at the file's last row — new
createTailTipBranchProofsynthesizes the marker from the last main-chain transcript row, so a prompt written just before a crash reconciles asacceptedrather thannot_delivered. - Durable point is the last completed turn —
ClaudeSession.turnEndLeafUuidadvances onresult; close and exit persist it viasettledClaudeTurnEndLeafafter the in-flight write settles. - Tests — a crash-between-prompt-and-echo history-window case, a new
structured-claude-pending-rewind.test.ts, and updates across the claude suites.
I ran the touched suites (1242 pass; only the four known sandbox exit-proof failures) and two independent specialists refuted the tail-tip and rewind-removal hypotheses.
ℹ️ PR description still documents the superseded --resume-session-at design
The description's ELI5, Findings, Mechanism, and Testing sections describe resolving the stored leaf to a real message and re-deriving it before spawn via --resume-session-at, and the rewind paragraph says "Rewinds are unchanged." Commit 5cb901c removes --resume-session-at entirely (resume by session id) and reports Claude rewind unsupported, so the description misstates both the mechanism and a user-facing capability change, and its Testing list references deleted tests. Please update it before merge so reviewers and future archaeology do not trust the old model.
Technical details
# Stale PR description after the resume-at pivot
## Affected sites
- PR description (ELI5, Findings, Mechanism, Testing, "Rewinds are unchanged") — still describes `--resume-session-at` re-derivation and claims rewinds are unchanged.
- `src/main/claude/claude-structured-launch-resolution.ts:239-243` — a resumed launch now emits `resume` alone.
- `src/main/claude/claude-structured-session-adapter.ts:63-67` — `rewindSupport` is a constant unsupported.
- `src/main/native-chat/agent-session-wire/structured-rewind-recovery.ts:33-59` — a pending Claude rewind is settled refused, not left pending.
## Required outcome
- The description matches shipped behavior: resume by session id, stored leaf as bookkeeping, Claude rewind unsupported, and the tests that actually exist.
## Open questions for the human (optional)
- Is disabling Claude rewind intended to land in this fix, or should it be split out so the capability change is reviewed on its own?ℹ️ Nitpicks
src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-runner.ts:9-11still says Claude re-acquires at "resume+resumeSessionAt"; onlyresumeremains.- After the rewind removal,
intentionalRewindUuid/ theintentional-rewindrelation insrc/main/claude/claude-transcript-branch-graph.tshas no production caller (onlyclaude-transcript-rewind-proof.test.tsandclaude-transcript-branch-streaming.test.tsexercise it). Keep it only if the fork-based rewind will reuse it.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…sume note The restart path resumes Claude by session id alone now; the module comment still described the old resume-at cursor.
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: 900ffc92-00eb-4212-bb80-eb1eb24ebec4
📒 Files selected for processing (1)
src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-runner.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.
| // Codex's thread id — which is native continuation. Nothing re-sends the user's prompt: that is | ||
| // what makes an agent redo work it already finished. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,180p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-runner.ts
rg -n 'resume-capable|childless|resumeSessionAt|resume:' src/main/native-chat/agent-session-wire src/main/claude/claude-structured-launch-resolution.tsRepository: stablyai/orca
Length of output: 8290
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- restart resume host ---'
sed -n '130,190p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts
printf '%s\n' '--- host lifetime ---'
sed -n '150,215p' src/main/native-chat/agent-session-wire/structured-agent-session-host-lifetime.ts
printf '%s\n' '--- Claude launch resolution ---'
sed -n '200,260p' src/main/claude/claude-structured-launch-resolution.ts
printf '%s\n' '--- provider and resume references ---'
rg -n -C 4 'resumeSessionAt|resumeSession|threadId|providerSessionId|structured.*launch|launch.*option|resume:' src/main src/test test 2>/dev/null | head -n 260
printf '%s\n' '--- restart resume tests ---'
sed -n '520,640p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume.test.ts
printf '%s\n' '--- relevant files ---'
git ls-files | rg '(^|/)(codex|claude|structured-agent-session|agent-session-wire).*(launch|resume|adapter|test)|provider'Repository: stablyai/orca
Length of output: 41746
🏁 Script executed:
printf '%s\n' '--- restart resume host ---'
sed -n '145,185p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume-host.ts
printf '%s\n' '--- host lifetime ---'
sed -n '160,210p' src/main/native-chat/agent-session-wire/structured-agent-session-host-lifetime.ts
printf '%s\n' '--- Claude launch resolution ---'
sed -n '220,255p' src/main/claude/claude-structured-launch-resolution.ts
printf '%s\n' '--- focused resume tests ---'
sed -n '540,635p' src/main/native-chat/agent-session-wire/structured-agent-session-restart-resume.test.ts
printf '%s\n' '--- resume option references ---'
rg -n -C 3 'resumeSessionAt|resumeSession|providerSessionId|threadId|resume:' src/main/native-chat src/main/claude src/main/codex 2>/dev/nullRepository: stablyai/orca
Length of output: 45545
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- resumed acquisition implementation ---'
rg -n -C 8 'function resumeHeldStructuredAgentSession|const resumeHeldStructuredAgentSession|resumeHeldStructuredAgentSession' src/main/native-chat/agent-session-wire
printf '%s\n' '--- acquisition options tests ---'
sed -n '1,230p' src/main/native-chat/agent-session-wire/structured-agent-session-acquisition-options.test.ts
sed -n '400,500p' src/main/native-chat/agent-session-wire/structured-agent-session-acquisition-options.test.ts
printf '%s\n' '--- provider launch/resume tests ---'
rg -n -C 6 'resume: providerSessionId|sessionId: providerSessionId|resumed:|resumeLeafUuid|resume.*thread|thread.*resume' src/main --glob '*test.ts' --glob '*test.tsx' | head -n 260Repository: stablyai/orca
Length of output: 42203
🏁 Script executed:
set -o pipefail
sed -n '1,155p' src/main/native-chat/agent-session-wire/structured-agent-session-hold-resume.ts
printf '%s\n' '--- adapter acquire contract ---'
rg -n -C 8 'interface StructuredAgentSessionAdapter|type StructuredAgentSessionAdapter|acquire:' src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts src/main/native-chat/agent-session-wire/structured-agent-session-attach-flow.tsRepository: stablyai/orca
Length of output: 6185
Correct the native-continuation rationale.
Native continuation does not resend the user's prompt. It resumes the provider's conversation and prevents the agent from repeating work it already completed.
Suggested comment fix
-// what makes an agent redo work it already finished.
+// what prevents an agent from redoing work it already finished.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Codex's thread id — which is native continuation. Nothing re-sends the user's prompt: that is | |
| // what makes an agent redo work it already finished. | |
| // Codex's thread id — which is native continuation. Nothing re-sends the user's prompt: that is | |
| // what prevents an agent from redoing work it already finished. |
The reconciliation readers proved the transcript tip by re-parsing every line and feeding a synthetic last-prompt row through the graph, doubling parse cost on every reopen and coupling the tail path to the marker's JSON shape. The graph now takes tip: 'file-tail' and tracks the last main-chain row from its own parse; marker mode is unchanged and the no-eligible-tail fallback keeps the exact marker semantics.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- File-tail branch proof moved into the graph —
createBranchProofnow takestip?: 'marker' | 'file-tail'; in file-tail mode the graph tracks the last main-chain row andfinishoverrides the leaf to it, replacing thecreateTailTipBranchProofwrapper and thetranscriptTailUuidre-parse inclaude-transcript-branch-proof.ts. - Replay entry points request the tail explicitly —
replayClaudeTranscriptBranchAncestry{FromJsonl}passtip: 'file-tail', andAncestryInputisOmit<BranchProofInput, 'tip'>so a caller cannot override it. - Tests — new
claude-transcript-branch-graph.test.tscases pin the file-tail tip when nolast-promptrow exists, and that marker mode still requires the marker on the same bytes.
The refactor is behavior-preserving. The old wrapper appended a synthetic last-prompt row at nextIndex and let the unchanged graph resolve it; the new code sets the same leafUuid / leafMarkerLineIndex in place at finish, so the leaf.lineIndex > leafMarkerLineIndex guard, the ancestry walk, and the sibling-branch path all resolve identically. Marker-mode callers (proveClaudeTranscriptBranch, proveClaudeTranscriptBranchFromJsonl) are untouched. I ran the four touched suites (claude-transcript-branch-graph, claude-structured-history-window, claude-transcript-rewind-proof, claude-transcript-branch-streaming): 53 tests pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Electron QA v2 for native Claude chat resume-by-session-id. Worktree Renderer ownership on every attach: A. Two turns — PASSLaunch argv (new chat, no
Sent Store B. SIGKILL, then reopen — PASSReopen argv: Sent Head leaf after that turn: C. Close handshake, then reopen — PASS
Reopen argv: Sent Head leaf D. Stale but valid stored point — PASSWith the app down, only chat 1's head Reopen argv: Sent The edited link still holds E. Hook-summary stored point, fresh chat — PASSChat 2 session Sent A real Reopen argv: Sent Head leaf Not verified
|
|
Electron QA v3 on the final head. Worktree Ownership on every attach: Main rebuild after the fast-forward, from the dev runner log for launch pid 59213: F. Reopen chat 1 on this head — PASSChat 1 argv: Sent G. SIGKILL during a chat 2 turn, then reopen — PASSSent The interrupted prompt is delivered. The chat shows that count prompt and the partial assistant lines Sent Not verified
|
Review status: ready for human review at
|












ELI5
When Orca reopens a native Claude chat, it used to tell Claude "continue from this exact message". The message Orca remembered was often old, and sometimes it was not a message at all. So a reopened chat quietly forgot recent turns, and newer Claude versions refused to start. Claude already knows where its own conversation ends. Now Orca just says "continue this conversation" and lets Claude pick up from its real latest state.
What Changed
Before. A long-running native Claude chat reopened at a point Orca had saved much earlier, sometimes a hook bookkeeping row from the day before. Each reopen branched the conversation off that point. Claude silently lost everything after it, while the chat still showed those turns on screen. With Claude 2.1.280 a point that is not on Claude's current chain fails in about a second with
No message found with message.uuid of: …. The chat then showed "The session has no live owner to accept writes" and could not be used.After. A reopened chat continues from Claude's real latest state, and it never wedges on a bad saved point. The screenshots below show a chat whose saved point was deliberately set back to its first message: after reopening, Claude still lists every earlier turn.
Mechanism
--resume-session-at. Claude's own loader decides where the conversation continues, and it follows the end of the file after a crash. The launch identity check now compares the session id only.result, the live owner records the leaf of the completed turn in the durable record. It revises the head provider-handle link that this owner minted in place, so the chain does not grow per turn. The update refuses a stale fence, a lease that is not live, and a head minted by another owner or for another provider session. The revised chain must pass the persisted chain validator. A failed write is only logged and retried at the next turn end. A result that arrives after the child's exit is ignored.last-promptmarker. A prompt Claude saved just before a crash now reconciles as delivered instead of being offered for a duplicate resend. The terminal handoff readers keep their existing marker-based behaviour.last-promptmarker at the rewind target right after start-up, which the real binary does not do, so onmainit always refused withproof-mismatch. No app screen, mobile client, or CLI command calls it. The rewind launch, proof, and recovery code is removed. A Claude rewind left pending by an older build settles as refused on the next attach, and the chat resumes by session id. A failed settlement is logged and never blocks the chat. Codex rewind is unchanged.Findings
last-promptmarker is not the conversation tip. Claude writes it irregularly: at a fresh session's first prompt, next to title rows, and on a graceful exit after a turn. It writes none when a resumed child starts, and none on a kill. In the QA transcript the latest marker trailed the file by two turns. When the file's last row descends from the latest marker, Claude's loader continues from the file's last row. Otherwise it continues from the marker.--resume-session-atcreates a side branch in Claude's file. Whether Claude follows that branch later depends on whether a marker happened to be written. So passing a saved point on every reopen, whichmaindoes, is itself what produces branched conversations and lost turns.Why
Claude owns where its conversation continues, and it already follows the end of its own file after a crash. Orca can only guess that point, and every guess it passes as
--resume-session-atmakes a new branch that the next guess has to account for. Resuming by session id removes the guess and the branch-making together. Orca keeps its own record of the last completed turn because the journal's delivery reconciliation and history window need an anchor. It never feeds that record back to Claude as a resume point.Alternatives considered:
--resume-session-atbut only accept message rows. This fixes the start-up failure, but not the silent context loss or the side branches.Known gaps, left for follow-ups.
forkedlink. Orca's earlier approach cut the same session back instead. That is a separate change.mainalready branched. Reconciliation walks the file's end, so for a transcriptmainalready branched it can, once after upgrading, mark a prompt delivered on a branch Claude will not continue.mainreturned "unknown" in that case. Claude's next write puts the two back in line.resumedlink toward the 256-link cap. This is not new, and this PR removes the extra close-time linksmainalso added.Linked Issue
Fixes #
Visual Proof
The same test on both sides: a chat answered ALPHA, then BRAVO. Its saved point was then set back to the first message, as happens when an owner dies before saving, and the chat was reopened and asked to list every word so far.
Before (an earlier revision of this PR, which re-derived the point from Claude's marker;
mainpasses the stale point directly and loses the same turns). The screen still shows BRAVO, but Claude answers onlyALPHA:After (this head). The reopen passes only
--resume=<session id>, and Claude answersALPHA BRAVO CHARLIE:A saved point on a
stop_hook_summaryrow, the reported wedge, now opens normally and answers with full context:Full Electron QA write-ups, including the launch arguments, record-store values, and the renderer ownership checks for each run:
Testing
Automated tests:
claude-structured-launch-resolution.test.ts: a reopen passesresumeand noresumeSessionAt. A different saved leaf under the same session id still launches.claude-structured-turn-resume-point.test.tsandagent-session-provider-handle-transition.test.tscover the per-turn write. The durable point advances after each turn, and the chain length and head link id stay the same. The revised record passesisAgentSessionRecord. The update refuses a stale fence, a released lease, a head minted at another fence, and another provider session. A failed write is logged and retried. A result after exit does not write.claude-structured-resume-point.test.ts: all three persist the last completed turn without reading the transcript. A reopen followed by a close with no turn keeps the saved leaf. The close cursor lands after an in-flight write.claude-structured-history-window.test.tsandclaude-transcript-branch-graph.test.ts: the history window ends at the last main-chain row and never at a trailing sidechain row. A prompt Claude saved just before a crash reconciles as accepted. File-tail mode proves a transcript that has no marker at all.structured-claude-pending-rewind.test.ts: a pending rewind from an older build settles as refused and the chat resumes by id, including a failed settlement.claude-structured-session-integration.test.tsasserts the durable leaf advances during a live session with zero transcript reads at close.Ablations: each change was removed on its own and the tests that pin it went red. That covers reintroducing
resumeSessionAtfrom the saved leaf, persisting the live leaf at close, walking to the marker instead of the file tail, dropping the file-tail tip mode, and dropping the pending-rewind settlement.Local runs:
pnpm tc:node,pnpm run check:code-quality:changed, andoxlinton every changed file pass.src/main/claude,src/main/native-chat, and the touchedsrc/main/runtimesuites pass. The exceptions are the real-binary tests, which already fail onmainon this machine.Manual: Electron QA on macOS in a folder workspace, described under Visual Proof. Not tested: Linux, Windows, SSH (structured Claude only launches on the local host), and a git worktree workspace.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
src/sharedtypes changed. Claude rewind is reported through the existingunsupportedrefusal reason on the existing optional support field.maincan still read them after a rollback. Records written bymainare only used as an anchor here.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)