Skip to content

fix(sandbox): preserve stopped resume failures#184

Merged
shekohex merged 1 commit into
mainfrom
pi/183-bug-preserve-typed-stopped-sandbox-resume-failur
Jul 10, 2026
Merged

fix(sandbox): preserve stopped resume failures#184
shekohex merged 1 commit into
mainfrom
pi/183-bug-preserve-typed-stopped-sandbox-resume-failur

Conversation

@shekohex

Copy link
Copy Markdown
Contributor

Summary

  • propagate stopped-box lookup and resume failures unchanged by default; never delete or create on that path
  • add recoverStoppedSandbox typed seam so products own snapshot/delete/confirmation policy, then authorize replacement creation
  • require a fresh replacement key for both sandbox name and idempotency identity; optionally override or suppress restore

Validation

  • pnpm vitest run src/sandbox/index.test.ts (120 passed)
  • pnpm typecheck
  • NODE_OPTIONS=--max-old-space-size=8192 pnpm build
  • pnpm test (138 files, 2,244 tests passed)
  • git diff --check HEAD^ HEAD

Proof

  • L1 local regression: a 409 EGRESS_PROXY_RECOVERY_REQUIRED-shaped error from match.resume() reaches the caller by object identity, with zero delete/create calls.
  • Recovery regression: product callback receives stopped box + error, performs its own delete, supplies snapshot restore, and creates only with box-w1-recovery as both name and idempotency key.

Consumer Path

  • tangle-network/gtm-agent#562 can return ok(null) while awaiting explicit retention approval, or snapshot/delete then return a durable fresh replacementBoxKey and restore spec.

Review Guide

  • src/sandbox/index.ts: Stage 2 now fails loud by default and permits only explicit product-authorized recovery.
  • src/sandbox/index.test.ts: typed/generic propagation, no implicit deletion, fresh identity enforcement, and restore decisions.

Closes #183

@shekohex shekohex merged commit c751849 into main Jul 10, 2026
1 check passed
@shekohex shekohex deleted the pi/183-bug-preserve-typed-stopped-sandbox-resume-failur branch July 10, 2026 19:15
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.

[BUG] Preserve typed stopped-sandbox resume failures instead of timing out

1 participant