fix(cursor): reuse conversation checkpoints for incremental continuation - #1940
fix(cursor): reuse conversation checkpoints for incremental continuation#1940keepitmello wants to merge 1 commit into
Conversation
Preserve Cursor's returned ConversationStateStructure after a successful no-tool turn and reuse that snapshot on validated linear continuations instead of rebuilding the full root history. Tool-result turns reuse the last completed checkpoint plus only the uncovered suffix. Compaction, helper/shadow isolation, account or model mismatch, missing refs, decode failures, and invalid_argument recovery keep the existing full-replay path. Bind checkpoint snapshots to conversation, credential identity, and model affinity. Keep an opaque process-local checkpointRef on Responses continuation state, pin referenced blobs for the checkpoint lifetime, and never treat OpenCodex usage as a cache-hit counter. Refs lidge-jun#1527
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
2/4 boxes ticked. This PR stays in draft until every box above is ticked. |
Summary
Refs #1527
Verification
What this change is supposed to prove is that a validated no-tool follow-up stops rebuilding old root history. Unit-test green is only the repo gate, not that proof.
Observed on this branch against the same Cursor account, after the local 2.24.2 process was running from this tree:
rootBytes58 → 40,175 → 80,292.continuationMode=checkpoint, same Cursor conversation id,rootBytes=0, and still answered from the prior turn (BETA-9).cursor-agentcontrol on the same account /cursor-grok-4.6-low: turn 1cacheReadTokens: 0/ input 18937; resume turn 2cacheReadTokens: 18816/ new input 331 / answerALPHA-7. OpenCodex still cannot report that counter authoritatively, so this is comparison data only.Not shown, and not claimed:
Repo gate only, so a reviewer can reproduce the mechanical checks:
bun run typecheckbun test tests/cursor-request-builder.test.ts tests/cursor-blob.test.ts tests/cursor-adapter.test.ts tests/cursor-discovery.test.ts tests/cursor-protobuf-events.test.ts tests/cursor-live-transport.test.ts tests/cursor-tool-continuation.test.ts tests/responses-state.test.tsbun run testbun run privacy:scanChecklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.