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 ( | ||
| receipt?.phase !== "prepared" && | ||
| (state.revision !== request.expectedRevision || | ||
| state.lifecycle === "ending") | ||
| ) | ||
| throw changed(); |
There was a problem hiding this comment.
🟡 Source End leaves continuation active
Once receipt.phase is prepared, check ignores a source End and continues attaching the child. The canceled continuation therefore returns a usable child attachment.
Learn more
The receipt becomes prepared before the final source checks and child attachment. From that point, both check and the lifecycle subscriber exempt the operation from source revision and ending-state validation. A concurrent source End can therefore complete while Continue still attaches and returns its child.
Example: Continue finishes seeding and persists phase: "prepared". The user ends the source before lifecycle.attach runs. The source revision advances, but the final checks accept it and Continue returns the child instead of rejecting.
Recommended fix: Keep source End and revision fencing active through the final attachment and return. Remove the prepared-phase exemptions in both check and the lifecycle subscription, while retaining the separate read-only child reconciliation path.
Was this helpful? React with 👍 or 👎 to provide feedback.
Primary change type
Problem and motivation
Continuing from retained history must create one new child, preserve its source, and reconcile lost acknowledgements without duplicating context or native work.
Summary and scope
Coordinate the durable receipt, exact dormant allocator, child association, frozen context acceptance and verified no-reply native seed. Gate Attach until preparation commits. Retry the original operation before consulting newer source records and recheck project/account/native identity throughout. Completed retries use read-only verification and preserve an already-running child's lease; mutating preparation rejects live leases. End also fences final attachment.
Related work
Related issue: https://linear.app/sapiom/issue/SAP-3292
Depends on #1016. Native stack target: main. Routes and production composition follow.
Validation
Tests and documentation
Eleven integration cases use real receipt, session metadata and accepted-source stores plus the lifecycle coordinator. Cover coalescing, lost accept/seed ACKs, current live retries, missing committed sources, authority/project changes, unavailable activation, and End during preparation or final attachment. Native protocol is separately tested against the selected runtime. Updated assistant-history.md. Increment is below1000 changed lines including tests/docs/changeset; SDK pr:size is absent.
Compatibility and release impact
Security
AI assistance
Checklist