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 (reserved === undefined && this.dormantAllocations.size >= 10_000) | ||
| throw new DormantSessionAllocationMismatchError(); | ||
| this.dormantAllocations.set(id, digest); | ||
| // Keep a failed reservation: only the exact operation may retry this ID. | ||
| await this.persistDormantAllocations(); |
There was a problem hiding this comment.
🟡 Dormant allocations exhaust permanently
After 10,000 distinct reservations, allocateDormant rejects every new child ID. dormantAllocations has no reclamation path, so Recorded Continue remains unavailable.
Learn more
Every new dormant child adds one durable entry before its public session row is created. The map enforces a hard 10,000-entry limit, but no close, activation, deletion, or compaction path removes entries. Successful reservations therefore consume capacity for the lifetime of the state directory. Once full, exact retries still work, but every new child ID fails with DORMANT_SESSION_ALLOCATION_MISMATCH.
Example: A long-lived Studio profile records 10,000 distinct Continue operations over time. Operation 10,001 uses a fresh child ID and fails even though all earlier sessions are closed.
Recommended fix: Define a safe reservation lifecycle and reclaim entries after their proof is no longer required. If proofs must remain permanent, replace the fixed entry cap with bounded archival or compaction that preserves collision protection without blocking new allocations.
Was this helpful? React with 👍 or 👎 to provide feedback.
| await this.persistIdentityCandidate(candidate); | ||
| await authorize(); | ||
| this.sessions.set(id, candidate); |
Primary change type
Problem and motivation
Recorded Continue needs a distinct Studio session before native preparation, but normal session creation starts a Terminal and can claim automatic project setup.
Summary and scope
Add a server-only dormant allocator with an explicit not-started Terminal marker. A durable allocation ledger binds the reserved child ID to the parent and validated workspace/project/principal identity. Repeated preparation returns that exact child; collisions, changed authority, and End races fail before publication. The allocator performs no Terminal preparation, native creation, or bootstrap.
Related work
Related issue: https://linear.app/sapiom/issue/SAP-3292
Depends on #997. Native stack target: main, preserving fixed Epic 2 ancestry through #987. This is the independent allocator primitive from planned PR10; explicit activation and Continue are dependent work.
Validation
Tests and documentation
Nineteen allocator cases cover no side effects, exact retry identity, restart, failed persistence, End races, authority changes, and existing ID conflicts. The internal API is documented in code. The repository has no pr:size script; measured increment is 630 changed lines, including tests.
Compatibility and release impact
Security
AI assistance
Checklist