Skip to content

fix(sandbox): bun run sandbox refuses in one line instead of reporting an unhandled exception (MMR-590) - #512

Merged
dbtlr merged 1 commit into
mainfrom
fix/mmr-590-sandbox-cli-errors
Oct 22, 2026
Merged

dbtlr merged 1 commit into
mainfrom
fix/mmr-590-sandbox-cli-errors

Conversation

@dbtlr

@dbtlr dbtlr commented Oct 22, 2026

Copy link
Copy Markdown
Owner

bun run sandbox destroy <unknown-id> printed a full UNHANDLED EXCEPTION report with a code frame, a stack trace, and a hint aimed at the CLI's author, all to say the sandbox doesn't exist. Every operator-facing condition in packages/sandbox behaved this way, because they threw plain Error and Loom treats a foreign throw as a defect.

They now throw a Loom failure class, so Loom prints the sentence and exits:

$ bun run sandbox destroy 11111111-1111-4111-8111-111111111111
Sandbox 11111111-1111-4111-8111-111111111111 does not exist.        # exit 1
$ bun run sandbox destroy nope
sandbox: Invalid sandbox ID "nope"; use the UUID that create or restore printed.
Run "sandbox destroy --help" to see the usage.                       # exit 2
  • SandboxError (a FatalError, exit 1) covers refusals and failed subprocesses. InterruptedError and skill-eval's SafetyError now extend it.
  • SandboxUsageError (exit 2) covers malformed options, sandbox IDs, and snapshot IDs.
  • verify, upgrade, and run used to crash on an unknown UUID inside record(). They now check that the sandbox exists first, sharing the guard with destroy. restore names a missing .dev/sandbox.json, snapshot directory, or snapshot instead of raising a bare ENOENT.
  • Anything else, such as a corrupt record that fails schema parsing, still escapes as a defect with its stack.

Tests: main.test.ts spawns the real CLI and checks for a one-line refusal with no UNHANDLED EXCEPTION and the right exit codes. workflow.test.ts covers the unknown-sandbox and missing-snapshot refusals. bun run verify passes.

Made with Claude Opus 5.5 in Claude Code.

…g an unhandled exception (MMR-590)

Operator-facing conditions in packages/sandbox threw plain Error, so Loom
reported each one as a foreign-throw defect with a code frame and a stack.
They now throw SandboxError (a Loom FatalError, exit 1) or SandboxUsageError
(exit 2 for malformed options and IDs). verify, upgrade, and run check that the
sandbox exists before recording to it, and restore names a missing
configuration, snapshot directory, or snapshot.
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 74 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: dec987e8-99f2-469c-8c48-2747de51358d
📥 Commits

Reviewing files that changed from the base of the PR and between 51c7051 and e2a6582.

📒 Files selected for processing: 11
  • .changes/mmr-590.md
  • packages/sandbox/src/failures.ts
  • packages/sandbox/src/host.ts
  • packages/sandbox/src/main.test.ts
  • packages/sandbox/src/main.ts
  • packages/sandbox/src/process.ts
  • packages/sandbox/src/skill-eval-sandbox.ts
  • packages/sandbox/src/skill-eval.ts
  • packages/sandbox/src/snapshot.ts
  • packages/sandbox/src/workflow.test.ts
  • packages/sandbox/src/workflow.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@kody-ai

kody-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@dbtlr
dbtlr merged commit 9456654 into main Oct 22, 2026
10 checks passed
@dbtlr
dbtlr deleted the fix/mmr-590-sandbox-cli-errors branch October 22, 2026 05:38
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