docs(design): plan — warm and resumable Daytona sessions (F-020)#5214
docs(design): plan — warm and resumable Daytona sessions (F-020)#5214mmabrouk wants to merge 1 commit into
Conversation
Plan-feature workspace for the two-tier warm-session design on top of PR #5197: Tier 1 parks the sandbox to stopped behind a default-off flag, Tier 2 defers a true running-warm pool. Includes the load-bearing finding that the vendored Daytona provider lacks pause/reconnect hooks, an ask-codex xhigh review round folded into the plan, and the open billing decisions. Claude-Session: https://claude.ai/code/session_018MaXPNpvzN22kngHno3VMj
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Feedback needed on three decisions before implementation starts: (1) the crash-orphan compute budget and the DAYTONA_AUTOSTOP value (5 min can stop a sandbox under a live long tool call; the old default was 15) — needs the billing owner; (2) where the sandbox-pointer fence lives (session_states generation column vs the existing turn counter vs the Redis owner claim) — see open-questions.md #3; (3) whether Tier 2 should ship at all before Tier 1's real second-turn latency is measured on E3. Everything else in plan.md is ready to implement once these are settled. |
The symptom
Every conversational turn on a Daytona agent pays a full sandbox creation, measured live at about 20 seconds per turn (QA finding F-020). A user's second message in the same chat waits through provision, mount, and harness startup that the first turn already paid for. PR #5197's durable continuity makes the resumed turn answer correctly, but no sandbox instance is ever reused.
What this PR contains
A design-only plan-feature workspace at
docs/design/agent-workflows/projects/warm-daytona-sessions/(README, context, research, plan, open-questions, status). No code changes. No live Daytona runs.The load-bearing finding
The working tree already carries the warm plumbing (PR #5197 plus the untested lifecycle commit
60990d396e:keepWarmpark at turn end, stored-id reconnect, native ACPsession/load,ephemeral: falsewith autoStop/autoArchive/autoDelete timers). But the vendored Daytona provider (sandbox-agent@0.4.2) implements nopauseand noreconnect. SopauseSandbox()falls back to delete, reconnect can never revive a stopped instance, and every turn still recreates. F-020's behavior stands at HEAD; only its mechanism description was out of date.The two tiers
session/loadthe harness. Parked cost is storage only; Daytona's own stop/archive/delete timers are the sweeper and crash backstop. Mostly prototyped already; the remaining work is two provider hooks, two failure-cleanup seam fixes in the vendored lifecycle, a compatibility fingerprint, and fenced pointer writes.Recommendation
Land Tier 1 behind a default-off flag, close the P0 lifecycle gaps, and enable it after one credit-controlled live test on E3. Defer Tier 2 until its eviction can enforce the running cap safely, a billing owner sets the knobs, and F-018 (the Daytona tool-call hang) lands so tool turns benefit too. Durable replay stays the always-correct floor.
Review round
An ask-codex (xhigh) design review ran on the draft plan; its P0 findings (broken failed-pause fallback, double-sandbox reconnect leak, unfenced pointer writes, no reuse compatibility check, unmeasured latency claim) are folded into
plan.mdand noted instatus.md.https://claude.ai/code/session_018MaXPNpvzN22kngHno3VMj