Skip to content

Recover sandbox cleanup after process crashes - #348

Open
mintuhouse wants to merge 1 commit into
mainfrom
mintuhouse/sandbox-durable-cleanup
Open

mintuhouse wants to merge 1 commit into
mainfrom
mintuhouse/sandbox-durable-cleanup

Conversation

@mintuhouse

@mintuhouse mintuhouse commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
  • Add database-backed crash recovery on top of the lifecycle ownership merged in Scope sandbox ownership and make cleanup reliable #344.
  • Record each named allocation before creation with an encrypted, identity-bound configuration snapshot. Share ownership across chat and connection tests through an Effect service and layer.
  • Renew ownership once a minute with a 15-minute deadline. Reuse the existing Effect ClusterCron to claim expired allocations and retry failed cleanup.
  • Purge sandboxes before Organization deletion and preserve cleanup access across provider configuration edits or deletion. Reconcile uncertain creation outcomes for a day, which can delay Organization deletion.
  • Patch the maintained TanStack Docker, Daytona, and Vercel adapters to preserve names, distinguish missing resources from outages, and delete Vercel sandbox entities. Each allocation adds one access lookup before recording an intent.
  • Share sandbox timeout/error handling and keep forks and snapshots disabled until their additional resources have durable ownership. Recovery still requires usable provider credentials and availability.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T18:32:44.526002Z 2ea75f3 New commits
🔒 Security Review ✅ Completed 2026-10-22T17:53:59.055437Z b63ada2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

mintuhouse commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation results for 2ea75f323123de9b19faacf6cec196589d7081e0:

  • Rebased onto main 8c45fee49947081becd001d0a7414d9021b472a4 and retargeted this PR to main after Scope sandbox ownership and make cleanup reliable #344 merged as 4802666c7ef996f97e2692c2a5655322f3775ca0. The original 31-file recovery patch is byte-for-byte unchanged.
  • Full local Platform ready gate passed: 668 tests passed and 2 skipped in 78.11 seconds. Formatting, OpenAPI validation, type-aware lint, Knip, build including /docs prerender, and binary validation passed. Binary size is 151.4 MiB.
  • Real Docker crash probes passed for a ready sandbox after file and command operations, and for interrupted creation followed by a late resource with the same name. The probes forced database expiry rather than waiting 15 minutes.
  • Platform browser suite with the real Docker provider passed all 15 tests in 4.9 minutes without retries.
  • Todos app browser suite finished with 65 passing tests and 1 failure in 2.6 minutes. The inherited directory cancellation test failed at examples/todos/e2e/specs/app/directory-cache.spec.ts:207 with json: Response has been disposed. Its intercepted response handler outlives the test and races context teardown. This test is unchanged from main. The same failure occurred during Scope sandbox ownership and make cleanup reliable #344 validation, where an unchanged isolated run and full rerun passed. It has now recurred, so this run is recorded as failed rather than rerun until green. A test teardown fix is deferred outside this sandbox recovery patch.
  • Cleanup verification found zero development or browser sandbox journal records and zero managed probe/browser containers. All five test-server ports were released.
  • Hosted checks currently pass except Platform unit tests, which are still running. There are no review threads on this PR. The exact-head ten-minute feedback monitor remains active.
  • Recovery uses the agreed 15-minute ownership deadline. Uncertain creation outcomes are reconciled for one day. Hosted-provider account access and model-backed chat were not exercised in this pass.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
www-astralbeam-ai 2ea75f3 Commit Preview URL

Branch Preview URL
Oct 22 2026, 06:33 PM

mintuhouse added a commit that referenced this pull request Oct 22, 2026
Protect active chat sandbox leases, reserve capacity before provisioning, and retain ownership through late provider creation or deletion. Isolate provider connections and await bounded development-server shutdown cleanup.

Preserve main's usage-cost handling. Keep durable crash recovery, its migration, and provider patches in follow-up #348.
Base automatically changed from mintuhouse/sandbox-run-leases to main October 22, 2026 18:25
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