Skip to content

fix(cli): stop a run's created sandbox before the harness closes - #75

Merged
sanchitrk merged 5 commits into
canaryfrom
claude/reverent-mahavira-1330e0
Oct 13, 2026
Merged

sanchitrk merged 5 commits into
canaryfrom
claude/reverent-mahavira-1330e0

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Summary

  • codework run exits 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 with statement has been finalized (a defect, so Effect.ignore did 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.scoped now sits inside the provide.
  • codework run logs to stderr, like acp, so stdout carries only the response.
  • Daytona reports missing paths as ENOENT. The toolbox rejected with DaytonaFileNotFoundError, which isNotFoundError does not recognise, so every missing AGENTS.md/CLAUDE.md logged a warning with a full axios dump. This also gives the read tool its usual not-found error on Daytona.
  • Tests load credentials from the root .env.local (aikit, codework, harness and the Vercel smoke script).
  • Runner-cycle E2E no longer races the interrupt. A 100-word reply could finish streaming before the interrupt landed (expected 'ended' to be 'failed'). It now asks for a reply long enough that it cannot.

Testing

  • New packages/codework/test/cli.sandbox.live.test.ts spawns the real CLI on memory, Daytona and Vercel sandboxes (OpenRouter deepseek/deepseek-v4.1-flash). It asserts exit 0, no ERROR/WARN on either stream, and snapshots the final sandbox row (offline, provider stopped) to __artifacts__/cli.sandbox.live.<driver>.json. It fails on the old run.ts (exit 1) and on the old Daytona provider (WARN lines).
  • Harness remote E2E (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.
  • codework cli.test.ts passes.
  • vp check and vp run typecheck pass.
  • Not run: sea.test.ts, which is not on this branch yet.

🤖 Generated with Claude Code

sanchitrk and others added 5 commits October 13, 2026 16:15
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>
@sanchitrk
sanchitrk merged commit d1cf9b0 into canary Oct 13, 2026
2 checks passed
@sanchitrk
sanchitrk deleted the claude/reverent-mahavira-1330e0 branch October 13, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant