-
Notifications
You must be signed in to change notification settings - Fork 33
expose deleteSession #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
expose deleteSession #186
Conversation
🦋 Changeset detectedLatest commit: 1019db7 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Claude Code ReviewPR #186 exposes the Architecture & ImplementationStrengths:
Issues Found1. Type mismatch in session-handler.ts:140 The handler returns the result directly, but there's a type mismatch: const result = await this.sessionManager.deleteSession(sessionId);
if (result.success) {
const response = {
success: true,
sessionId,
timestamp: new Date().toISOString()
};
return this.createTypedResponse(response, context);
}
Fix: This is actually correct behavior - the handler is responsible for creating the HTTP response shape. However, the naming could be clearer since 2. Missing type export in packages/sandbox/src/index.ts The changeset mentions returning Verification needed: Confirm whether Minor Observations
VerdictThe implementation is production-ready. The type mismatch concern in #1 is actually not an issue upon closer inspection - the handler correctly transforms the service result into an HTTP response. Consider the export question in #2, otherwise this is good to merge. |
Expose the deleteSession functionality in the changeset.
commit: |
🐳 Docker Image PublishedFROM cloudflare/sandbox:0.0.0-pr-186-668fddbVersion: You can use this Docker image with the preview package from this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a quick scan, this is looking good so far! The only gap is perhaps that we're not yet killing running commands (see packages/sandbox-container/src/session.ts) and cleaning out all related resources (labellers and pid files). Much of that logic should be present in this one file.
deleteSession(sessionId)methodsandbox.destroy())SessionDeleteResultwith success status, sessionId, and timestamp