Skip to content

fix(server): avoid loading v2 transcripts for checkpoint effects - #12339

Open
juliusmarminge wants to merge 1 commit into
checkpoint-v2/restore-safetyfrom
checkpoint-v2/targeted-reads
Open

juliusmarminge wants to merge 1 commit into
checkpoint-v2/restore-safetyfrom
checkpoint-v2/targeted-reads

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

V2 checkpoint capture and rollback loaded the full thread projection, including conversation history and fork ancestry. Long conversations unnecessarily allocated and decoded large transcript payloads, and obsolete unrelated history could prevent checkpointing.

Add transactional reads for the exact checkpoint targets and switch capture/rollback to them. Finalization also uses checkpoint metadata for its workspace refresh instead of reloading the conversation after capture. Capture reads only its run, root node, scope, provider thread, and baseline readiness columns. Rollback retains the target attempt/provider turns, completed later runs/root nodes, bound session, and ready later checkpoints needed for existing rollback behavior. The in-memory store follows the same target selection.

Depends on #12338 and targets v2 from #2829.

Verification: two capture cases fail on the old full-read path and pass with these reads, while preserving concurrent delegated completion and at-least-once idempotency. SQLite/memory parity tests cover target selection, stale checkpoint scope/status filtering, and cross-thread ownership. An actual SQLite regression ignores obsolete transcript, unrelated run, and checkpoint file payloads. The seven focused projection/checkpoint/provider-control/finalization suites pass (52 tests). Server typecheck and focused lint pass.

A synthetic SQLite conversation with 200 × 128 KiB assistant items (25 MiB) measured these median read times over ten warmed reads on Node 24:

Read Median
Full thread projection 139.25 ms
Capture context 0.44 ms
Rollback context 0.80 ms

This measures database projection work only, not Git capture/restore latency. No timing thresholds were added to tests. Backend-only change; no visual evidence applies.

Prepared with Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 18, 2026
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 05ed3bf.

This comment will update automatically after the next completed run.

@juliusmarminge
juliusmarminge force-pushed the checkpoint-v2/targeted-reads branch from 6974410 to f1547a7 Compare September 18, 2026 00:41
@macroscopeapp

This comment has been minimized.

@juliusmarminge
juliusmarminge added this pull request to stack #12340 September 18, 2026 00:41
@juliusmarminge
juliusmarminge force-pushed the checkpoint-v2/targeted-reads branch from f1547a7 to ab03d21 Compare September 18, 2026 00:44
@macroscopeapp

macroscopeapp Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR substantially replaces full transcript projection reads with new target-specific SQLite and in-memory selection logic across checkpoint capture, rollback, and finalization. Although the scope and tests are focused, these critical runtime and persistence-path changes merit human review.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge force-pushed the checkpoint-v2/targeted-reads branch from ab03d21 to 05ed3bf Compare September 18, 2026 00:56
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 1, 2026 — with ChatGPT Codex Connector

This branch has not been deployed

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

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant