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 |
| try { res.json(await sessionManager.activateDormant(req.params.id)); } | ||
| catch (error) { if (!sendResumeError(res, error)) next(error); } |
There was a problem hiding this comment.
🟡 Shutdown returns an internal error
During shutdown, activateDormant rejects with SessionManagerClosingError. sendResumeError omits that error, so Terminal start returns 500 instead of 409.
Learn more
Terminal start shares the resume error mapper, which handles preparation conflicts but omits the manager's shutdown error. The manager explicitly rejects every new dormant activation once beginShutdown() runs. The endpoint therefore reaches the generic Express error handler rather than returning a lifecycle conflict.
Example: A start request arrives after sessionManager.beginShutdown(). activateDormant() rejects with code SESSION_MANAGER_CLOSING; the client receives HTTP 500 rather than HTTP 409 with that code.
Recommended fix: Add SessionManagerClosingError to sendResumeError's 409 branch, and cover the Terminal start route with a shutdown rejection test.
Was this helpful? React with 👍 or 👎 to provide feedback.
Primary change type
Problem and motivation
A dormant Studio child has no Terminal vendor ID, so ordinary Resume cannot start its first Terminal. Creating another session would lose its Studio and Assistant association.
Summary and scope
Add explicit same-ID dormant Terminal activation and a boot-protected start endpoint. Revalidate workspace authority, prepare current credentials through the existing launch builder, and launch without initial prompts or automatic project bootstrap. Coalesce duplicate starts and fence End races before spawn. Register exit handlers before awaiting first publication so fast exit and cleanup are observed.
Related work
Related issue: https://linear.app/sapiom/issue/SAP-3292
Depends on #1004 and consumes the allocator in #998. Native stack target: main. The Start Terminal UI follows the history/Continue pane work.
Validation
Tests and documentation
Twenty-three activation cases cover no bootstrap, fresh credentials, exact retry, current authority, End during preparation/publication, and real Assistant association preservation. Route tests reject overrides and map expected conflicts. Added dormant-terminal.md. Measured increment: 651 changed lines including tests and changeset; pr:size is absent.
Compatibility and release impact
Security
AI assistance
Checklist