Skip to content

fix(sandbox): renew lifecycle from active OpenCode turns - #6480

Merged
markokraemer merged 1 commit into
mainfrom
sandbox-active-turn-liveness
Aug 17, 2026
Merged

fix(sandbox): renew lifecycle from active OpenCode turns#6480
markokraemer merged 1 commit into
mainfrom
sandbox-active-turn-liveness

Conversation

@markokraemer

Copy link
Copy Markdown
Contributor

Problem

Provider-native sandbox timers can stop a sandbox while an OpenCode turn is still running. Passive traffic can also obscure the real idle boundary. The result is a "session will be restored" interruption during long-running agent work.

The separate 90,000 ms model-stream timeout is not part of this PR.

Contract

  • Persist token-scoped delivering authority before prompt delivery.
  • Promote only after OpenCode accepts the exact prompt identity.
  • Renew deadline_at and provider-native lifecycle only from fresh exact-turn evidence.
  • Treat unknown evidence as non-renewing.
  • Remove only the matching terminal token.
  • Linearize prompt delivery against idle stop with lifecycleStopClaim.
  • Keep passive session-data polling lifecycle-neutral.
  • Remove the 24-hour cap for verified active turns.
  • Never wake a stopped sandbox during renewal.

Providers

  • E2B: bounded static Sandbox.setTimeout renewal.
  • Daytona: verify running, then execute a bounded true command.
  • Platinum: execute a bounded true command through /exec.

Verification

  • API lifecycle/schema PostgreSQL tests: 29 pass, 0 fail.
  • DB package: 219 pass, 18 skip, 0 fail.
  • API unit suite: 6991 pass, 74 skip, 0 fail.
  • Sandbox daemon: 605 pass, 0 fail.
  • pnpm test -- --packages-only: PASS.
  • pnpm test: PASS across all five core lanes.
  • pnpm test -- --full: PASS in 228.2s.
  • Full API/CLI flows: 373/373 pass.
  • Full browser lane: PASS.
  • API, daemon, and DB typechecks: PASS.
  • Migration lint and Squawk lint: PASS.

Deployment proof required after merge

  • Verify Dev API SHA matches the merge SHA.
  • Verify a fresh guest contains the new daemon lifecycle literal.
  • Run deterministic one-minute active/idle/stop/no-wake tests on E2B, Daytona, and Platinum.

@strix-security

strix-security Bot commented Aug 17, 2026

Copy link
Copy Markdown

Strix Security Review

No security issues found.

Updated for 47b4aa4.


Reviewed by Strix
Re-run review · Configure security review settings

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
suna Ignored Ignored Aug 17, 2026 12:55am

Request Review

@markokraemer
markokraemer merged commit 344717c into main Aug 17, 2026
30 of 31 checks passed
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