Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced 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 |
| if (retry && expected === request.expectedRevision) | ||
| return publicLifecycle(current!); |
There was a problem hiding this comment.
🟡 Altered retry execution goes unnoticed
When an operation ID is retried with different execution, commitResume returns the prior lifecycle instead of rejecting the changed intent. Callers receive success for an operation they did not request.
Learn more
execution controls the lifecycle written by the original Resume commit, but it is not included in the persisted operation proof. The early idempotent-return path therefore needs to compare it against the committed lifecycle. This check applies only to a duplicate submitted from the original revision; crash restoration from the committed revision can still deliberately advance the operation to paused execution.
Example: An open, enabled session at revision 1 commits operation f187… with execution: "enabled", producing revision 2. A retry of f187… from revision 1 with execution: "paused" currently succeeds and returns the enabled revision 2 lifecycle instead of rejecting the changed request.
Recommended fix: Before the early return in commitResume, require current.execution === execution. Keep restart reconciliation unchanged when expected is the proof's committed revision.
| if (retry && expected === request.expectedRevision) | |
| return publicLifecycle(current!); | |
| if (retry && expected === request.expectedRevision) { | |
| if (current!.execution !== execution) | |
| throw new AssistantSessionRevisionError(); | |
| return publicLifecycle(current!); | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
Primary change type
Problem and motivation
A lost Resume acknowledgement must identify the exact operation that reopened the original Assistant. Separate lifecycle and receipt writes leave a crash window with no reliable proof.
Summary and scope
Commit private Resume operation UUID, original revision and exact saved-association digest atomically with the open lifecycle. Strip the proof from all public lifecycle projections. Exact retries reconcile the committed revision; later lifecycle changes invalidate replay. Restoring a runtime after a crash advances a paused lifecycle under the same operation proof.
Related work
Related issue: https://linear.app/sapiom/issue/SAP-3292
Depends on #1009. Native stack target: main. The next coordinator consumer performs exact native/context preflight and lease handoff.
Validation
Tests and documentation
Real-file tests cover concurrent commits, exact duplicate writes, restart reconciliation, changed binding/request/revision, private proof stripping, corrupt metadata, cancellation and post-publication fsync rollback. Updated assistant-history.md. Increment:407 changed lines including tests/docs/changeset; pr:size is absent.
Compatibility and release impact
Security
AI assistance
Checklist