-
Notifications
You must be signed in to change notification settings - Fork 853
fix(cursor): reuse conversation checkpoints for incremental continuation #2054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
keepitmello
wants to merge
5
commits into
lidge-jun:dev
from
keepitmello:fix/cursor-checkpoint-recut
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
766b81a
fix(cursor): reuse conversation checkpoints for incremental continuation
keepitmello 1ffee21
fix(cursor): pin store:false chat hops and helper-owned cache
keepitmello 3c3f843
fix(cursor): keep recovered checkpoints and close review holes
keepitmello a8f007d
fix(cursor): fail closed on stale refs and prefix collisions
keepitmello 90f585e
fix(cursor): frame checkpoint digests and drop stale recovery state
keepitmello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Clear a failed attempt's transport capture before forced-fresh recovery.
If the first attempt receives a heartbeat that exposes
capturedConversationCheckpoint()and then fails withinvalid_argument,lastTransport.capturedremains set. If the fresh retry completes without a capture,commitCapturedCheckpoint()stores the rejected attempt's checkpoint under the new conversation ID.src/adapters/cursor.ts#L253-L257: ClearlastTransportbeforeawait runOnce(request)for the forced-fresh request, or make captured state local to eachrunOnce()invocation.tests/cursor-adapter.test.ts#L337-L394: Make the rejected attempt emit a heartbeat and expose distinct checkpoint bytes. Make the recovery complete without a capture. Assert that no checkpoint is committed from the rejected attempt.As per path instructions, "
tests/**: A behavior change insrc/should come with a focused regression test near the existing tests for that subsystem."📍 Affects 2 files
src/adapters/cursor.ts#L253-L257(this comment)tests/cursor-adapter.test.ts#L337-L394🤖 Prompt for AI Agents
Source: Path instructions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runtime fix is present on the current head:
lastTransportis cleared before the forced-fresh retry. I am leaving this thread unresolved because the regression still returns no capture from the rejected first attempt and a capture from recovery. That test would pass without the clear. Please make attempt one expose distinct checkpoint bytes and recovery expose none, then assert that the rejected checkpoint is not committed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 15840
@Ingwannu, confirmed. The current regression attests/cursor-adapter.test.tsLines 337-395 cannot detect removal oflastTransport = undefined.Attempt one returns no checkpoint bytes. Recovery returns
recoveredBytes. The test therefore passes even if the rejected attempt capture leaks into recovery.tests/cursor-adapter.test.ts.heartbeat, expose distinct rejected checkpoint bytes, and then throwinvalid_argument.donewith no checkpoint capture.You are interacting with an AI system.