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 |
| async resume( | ||
| id: string, | ||
| expectedRevision: number, | ||
| operationId: string, | ||
| ): Promise<AssistantAttachment> { |
There was a problem hiding this comment.
🔴 Resume validation is never used
Production never calls AssistantNativeHistory.resume. The attach endpoint still uses attach, so restored sessions bypass the new validation.
Learn more
AssistantNativeHistory has no production imports or construction sites. Only its unit test instantiates it. The browser resumes an ended session through POST /opencode/:id/attach, which calls AssistantLifecycleCoordinator.attach. That path can start the saved runtime and return a lease without executing this reader or its retained-context preflight.
Example: After a server restart, a saved conversation references unavailable retained context. Opening it calls attach, starts the runtime, and returns a lease. The new resume validation never runs, so execution can continue despite the unavailable context.
Recommended fix: Construct AssistantNativeHistory in startServer with the saved-association authority and delivery recovery preflight. Route explicit Resume requests to AssistantNativeHistory.resume with an operation UUID, while preserving ordinary live-runtime attachment behavior.
Was this helpful? React with 👍 or 👎 to provide feedback.
Primary change type
Problem and motivation
Resume must validate the exact saved native conversation and original execution context before making that runtime available again.
Summary and scope
Reuse the bounded native-history reader inside the Resume coordinator's retained operation. Revalidate the complete saved association around IO, preserve typed missing-history/context errors, and return only a public attachment. Empty saved conversations do not invent context. No prompt, replacement association, or Terminal startup occurs.
Related work
Related issue: https://linear.app/sapiom/issue/SAP-3292
Depends on #1014. Native stack target: main.
Validation
Tests and documentation
Native-history cases cover exact GET-only Resume, empty saved history, complete association changes, missing history/context, and hung authorization/query/preflight. Updated assistant-history.md. Increment:352 changed lines including tests/docs/changeset; SDK pr:size script is absent.
Compatibility and release impact
Security
AI assistance
Checklist