Repository navigation
fix(cli): stop a run's created sandbox before the harness closes - #75
Merged
Merged
Conversation
The run's scope wrapped the provided harness layer, so its finalizers, including stopping the sandbox the run created, ran after the database had closed. Scope inside the provide instead, and log to stderr so stdout carries only the response. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codework runexits 0 and stops the sandbox it created. The run's scope wrapped the provided harness layer, so the finalizer that stops a created sandbox ran after the database had closed. It died withstatement has been finalized(a defect, soEffect.ignoredid not swallow it) and the run exited 1 after printing the response. Daytona and Vercel sandboxes were left running, because the stop never reached the provider.Effect.scopednow sits inside the provide.codework runlogs to stderr, likeacp, so stdout carries only the response.ENOENT. The toolbox rejected withDaytonaFileNotFoundError, whichisNotFoundErrordoes not recognise, so every missingAGENTS.md/CLAUDE.mdlogged a warning with a full axios dump. This also gives thereadtool its usual not-found error on Daytona..env.local(aikit, codework, harness and the Vercel smoke script).expected 'ended' to be 'failed'). It now asks for a reply long enough that it cannot.Testing
packages/codework/test/cli.sandbox.live.test.tsspawns the real CLI on memory, Daytona and Vercel sandboxes (OpenRouterdeepseek/deepseek-v4.1-flash). It asserts exit 0, noERROR/WARNon either stream, and snapshots the final sandbox row (offline, providerstopped) to__artifacts__/cli.sandbox.live.<driver>.json. It fails on the oldrun.ts(exit 1) and on the old Daytona provider (WARN lines).CODEWORK_SANDBOX_E2E_REQUIRED=1: vercel, daytona, remote.driver, tools.registry.remote, session.relink, plugin.instruction): all pass. The runner-cycle case passed 3/3 after the fix.codeworkcli.test.tspasses.vp checkandvp run typecheckpass.sea.test.ts, which is not on this branch yet.🤖 Generated with Claude Code