Skip to content

fix: retain managed Daytona cleanup after uncertain creation - #1579

Merged
steipete merged 2 commits into
mainfrom
steipete/daytona-managed-uncertain-create
Aug 28, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/daytona-managed-uncertain-create

Conversation

@steipete

@steipete steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1575 — managed Daytona loses cleanup after an unacknowledged create.

The real managed lifecycle and lost-response/native-expiry proof now pass. Final head 029b4c28a46c3d5a1d26eeec6efb9630bbe6caab adds the release note and rebases onto d024b182260d671973f0eb979e966ea6a7054332; its entire worker/ tree is byte-identical to the live-tested 21bc20c6e6ff72496d0b83263e2473642f1474b8. All 20 relevant checks on the exact final head passed, including the non-bypassable Release Check. Merging triggers the normal production coordinator deployment; no tag or package release is requested.

Additional instructions

Keep Allow edits from maintainers enabled where applicable. This branch is in the upstream repository and is takeover-ready.

What Problem This Solves

Resolves a problem where a managed Daytona allocation could succeed upstream but become invisible to coordinator cleanup after its response was lost and an immediate inventory lookup returned nothing. Failure, release, restart, and expiry could then discard uncertainty without establishing that the sandbox was gone.

The original composed secretless reproduction failed in six cases across fixed-ID PUT and ordinary POST with no release, release during creation, and release after failure. The inventory response shape is valid: this is a lifecycle-ownership bug, not list decoding.

Why This Change Was Made

The provider requests native creation-relative wall-clock TTL in the original allocation. The coordinator records a returned exact UUID and original request-context fingerprint before readiness can race release or restart, and preserves explicit unresolved responsibility when it receives no UUID. Cleanup requires the original API, configured organization, and credential context, checks exact ownership, then observes terminal provider state or exact-resource absence. DELETE acknowledgment alone is not completion.

Immediate name/label adoption and provider-local readiness rollback are removed in favor of the existing coordinator lifecycle owner. Provider-authoritative recovery cannot fall through to generic label discovery. Fixed PUT retains its public replay/cancellation contract. There is no new datastore, schema version, configuration option, dependency, or direct-Go change.

The first live control caught an error in this patch's original deadline check: Daytona's creation and TTL timestamps differed by the requested five minutes plus 1 ms. Readiness now pins a maximum remaining native deadline once when observation begins, rejects missing/expired/excess deadlines, and never extends the bound while polling. It adds no arbitrary clock tolerance.

User Impact

Operators get a visible unresolved outcome rather than false cleanup success after an ambiguous create. Native TTL applies to kept and explicitly retained managed sandboxes, starts at provider creation, and is not extended by heartbeats. API versions that silently ignore TTL are not accepted as ready.

Legacy records without scope and changes to the API endpoint, organization, or API key deliberately fail closed for cleanup and access refresh. This includes same-organization key rotation. Finish cleanup before rotating credentials, or restore the original context and repeat explicit stop. Missing historical scope requires operator resolution, never backfilling from current configuration. These rollout tradeoffs were explicitly approved. Empty inventory and elapsed TTL never become deletion proof.

Evidence

Real managed lifecycle and authority boundary

Completed August 28, 2026, 20:11 UTC using the official signed 0.46.0 CLI, the actual candidate Worker under local workerd with persistent Durable Objects, and the real Daytona API. The original failed control was already cleaned up; the separately authorized retry enforced a cumulative maximum of three task sandboxes, five-minute requested native TTL each, and a $1 total ceiling. All three are confirmed terminal. The successful retry required no emergency DELETE, and the outbound safety guard blocked zero requests.

The known-ID case completed managed warmup, then the documented crabbox ssh --show-secret handoff executed a fixed printf over real noninteractive SSH, exit 0. The token-bearing handoff was captured only in memory and redacted before evidence storage. A task-only SSH wrapper excluded host SSH profiles, pre-existing identity files, and agent access; host-key verification used task-only known_hosts. No repository sync or run-history claim is made.

While the same sandbox existed, real Worker restarts changed the non-admin caller, provider credential context, API URL, and organization. The different caller received HTTP 404. Each provider-context mismatch accepted release intent but retained the exact UUID and original scope with visible cleanup/failure diagnostics. Every negative case produced zero provider I/O, not a request blocked by the harness. Replacement key/URL/organization values were synthetic changes to the isolated Worker's trusted configuration; no new credential was minted and no other provider account was contacted. After restoring the original context, ordinary managed stop exited 0; the Worker trace shows exact-resource GET 200 → DELETE 200 → GET 404. Independent exact-ID observation also returned 404.

Real lost-response and native expiry

The observer captured a real create HTTP 200 and withheld its UUID by returning HTTP 502 to the Worker. The CLI visibly failed; its fixed-PUT replay returned 409 without another provider create. Explicit release and a real Worker restart preserved empty cloudID, the original scope/dispatch evidence, and both unresolved diagnostics.

The native deadline was 20:10:51.951 UTC. Exact-resource HTTP 404 was observed at 20:11:17.204 UTC, about 25.3 seconds later. The Worker made zero provider requests after the lost create: no inventory adoption, SSH access, or DELETE. The coordinator still correctly reported unresolved after observer-known native termination, because it never received the UUID. This observed timing is not a provider teardown SLA.

The nine-request Worker/control trace was: inventory GET; known create POST; exact readiness GET; SSH-access POST; exact ownership GET; DELETE; exact GET 404; independent known-completion GET 404; lost create POST with provider 200 / delivered 502. The observer's native-expiry polling used only the separately retained exact UUID. No database rows were manually edited.

Regression, compatibility, and review

  • Original reproduction: six intended pre-fix failures; known-ID control and existing client tests passed.
  • Expanded lifecycle regressions against unchanged baseline production: 31 intended failures.
  • Live clock-drift fixture: five ready-state cases failed before correction and pass afterward; another case protects the fixed polling bound.
  • Focused owner suites: 754 passed, including after the final rebase.
  • Full Worker suite: 1,634 passed, 3 skipped, across 41 passing and 2 skipped files.
  • Formatting, lint, Worker and Node typechecks, standard Worker dry-run build, dynamic-worker dry-run build, and Node build passed.
  • Fresh restricted, credential-scanned pre-land Codex autoreview: no actionable P0 findings, including the release note. No broader-priority audit is implied.
  • The earlier full local docs check was stopped for host disk pressure, not counted as passing. Exact-head CI on the live-tested head passed Worker, Docs, rendered docs proof, all Go checks, CodeQL, connector smokes, and the non-bypassable Release Check. The final note/rebase head also passed all 20 gates: CI, connector smokes, docs proof, Release Check, and CodeQL.

The missing-scope upgrade also passed a supplementary real-runtime/persistent-store check. Byte-verified stable v0.47.0 source (0a55378990265271f5830a465aa643605d7d41f3) naturally created a managed, known-ID, unscoped lease through authenticated public POST. The current Worker reopened the same native SQLite Durable Object store, accepted release intent, and its native alarm persisted explicit unresolved cleanup with the UUID intact and zero provider calls. A second reopen retained that outcome. SQLite inspection was read-only; no row was manufactured or backfilled. Both source versions used the installed workerd engine, and the old provider's three responses were synthetic: this proves the runtime/store upgrade, not an observed historical Cloudflare deployment or another real-cloud allocation.

Maintainer rollout decision: the maintainer explicitly approved fail-closed cleanup/access refresh for legacy unscoped leases and changed credentials, including same-organization rotation, before implementation. Existing unscoped leases require manual resolution in their original provider account; they must not be silently adopted or backfilled from current configuration. New native TTL is not retroactive. This is the accepted cutover policy requested by the latest ClawSweeper review, not an unapproved migration gap.

Commands:

npm test --prefix worker -- test/daytona.test.ts test/fleet.test.ts
npm test --prefix worker
npm run format:check --prefix worker
npm run lint --prefix worker
npm run check --prefix worker
npm run check:node --prefix worker
npm run build --prefix worker
npm run build:cloudflare-dynamic-workers --prefix worker
npm run build:node --prefix worker
git diff --check

Dependency contracts inspected: public Daytona clients at dbf05b3f7a1b79caa0bf7cc77593fb5851811f0c (CreateSandbox.ttlMinutes, Sandbox.autoDestroyAt, eventually consistent inventory); historical public server v0.190.0 at 01c502bb1f1ff8f2885d0cd490e043736083dca8; and the live API schema. Historical source is not claimed to identify the current hosted server revision or guarantee teardown latency.

Scope/size: 8 files; production +404/-175, net +229; tests +1,057/-4, net +1,053; docs/changelog +59/-8, net +51. Production growth owns early durable identity publication, original-context fencing, and unresolved lifecycle responsibility. Immediate label recovery and adapter-local rollback were removed; sibling provider/cancellation/cleanup paths are covered by the full Worker suite.

Review follow-through: the real managed lifecycle, unauthorized caller/context rejection, matching-context deletion, restart/release persistence, native expiry, and zero-residue requests in the ClawSweeper review are now demonstrated. The legacy cutover decision and the distinction between real-store upgrade and synthetic provider transport are recorded above. Tagged releases and package publication remain out of scope; production deployment uses the normal main-triggered workflow.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 28, 2026, 4:30 PM ET / 20:30 UTC.

ClawSweeper review

What this changes

The PR persists exact Daytona resource identity and original provider context during brokered creation, adds native sandbox TTL checks, and retains unresolved cleanup state after a lost create response.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Needs maintainer review before merge - 4 items remain

Keep open: the branch addresses the open Daytona cleanup bug and has substantial real-provider evidence, but its intentional fail-closed treatment of legacy unscoped lease records needs an explicit maintainer rollout decision before merge.

Priority: P1
Reviewed head: 029b4c28a46c3d5a1d26eeec6efb9630bbe6caab
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Real-provider lifecycle evidence is strong, but the deliberate legacy upgrade break needs an explicit maintainer decision before the patch is merge-ready.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The changed production owners are the Coordinator’s durable resource publication and Daytona’s scoped exact-resource cleanup. The supplied body reports an after-fix real Daytona/local-workerd run covering managed create and SSH use, original-context GET→DELETE→404 completion, context-mismatch rejection before provider I/O, and lost-response native expiry with preserved unresolved state; this is sufficient real-path evidence for the changed authority boundary.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The changed production owners are the Coordinator’s durable resource publication and Daytona’s scoped exact-resource cleanup. The supplied body reports an after-fix real Daytona/local-workerd run covering managed create and SSH use, original-context GET→DELETE→404 completion, context-mismatch rejection before provider I/O, and lost-response native expiry with preserved unresolved state; this is sufficient real-path evidence for the changed authority boundary.
Evidence reviewed 6 items Introduced lifecycle ownership change: The verified PR delta adds early resource-claim publication before readiness, so an acknowledged UUID is durable across release or restart races.
Authority boundary implementation: Cleanup validates a UUID-shaped claim and requires the persisted scope to match the currently configured Daytona context before provider I/O.
Legacy-upgrade behavior is explicit: The added regression test deletes providerScope from an otherwise active Daytona lease, then verifies release leaves cleanup unresolved and makes no provider requests even after the original configuration is restored.
Findings 1 actionable finding [P1] Resolve legacy Daytona leases before enforcing scope
Security None None.

How this fits together

The Worker coordinator creates brokered leases, persists their lifecycle state, and later releases or expires them. Its Daytona provider adapter allocates sandboxes and performs identity-checked cleanup, while the coordinator schedules retries and exposes lease status.

flowchart LR
  A[Brokered lease request] --> B[Coordinator reservation]
  B --> C[Daytona sandbox allocation]
  C --> D[Persist exact UUID and scope]
  D --> E[Readiness and SSH access]
  D --> F[Scoped cleanup]
  F --> G[Observed deletion or unresolved record]
Loading

Decision needed

Question Recommendation
Should existing brokered Daytona leases without a persisted provider scope be intentionally left for manual operator resolution on upgrade, rather than receiving automatic cleanup or access refresh? Approve the fail-closed cutover: Record explicit approval and rollout guidance that existing unscoped Daytona leases require operator resolution before this change deploys.

Why: This is a deliberate tradeoff between preserving a working legacy workflow and preventing a new credential or endpoint context from gaining deletion authority; source alone cannot choose that policy.

Before merge

  • Resolve legacy Daytona leases before enforcing scope (P1) - getOwnedServer rejects every persisted Daytona lease without providerScope; the added regression deliberately shows that even an otherwise active, same-context legacy lease then cannot refresh access or be deleted. This is a P1 upgrade break, so add an approved transition/operational path or record explicit maintainer acceptance of the fail-closed cutover before merge.
  • Resolve merge risk (P1) - Deploying this change with an existing Daytona lease record that lacks providerScope blocks its later access refresh and automatic deletion, even when the operator has not changed credentials or endpoint configuration.
  • Complete next step (P1) - A maintainer must decide whether the fail-closed behavior for existing unscoped Daytona records is an acceptable upgrade policy before any implementation follow-up.

Findings

  • [P1] Resolve legacy Daytona leases before enforcing scope — worker/src/daytona.ts:158-168
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 8 files affected The patch spans the coordinator, Daytona adapter, lifecycle documentation, and focused regressions.
Production versus tests production +404/-175; tests +1,057/-4 The substantial regression suite matches a broad lifecycle-state change, while the production expansion merits the rollout decision above.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #1575
Summary: This PR is the candidate fix for the linked open report about managed Daytona cleanup after an unacknowledged create.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Approve the documented fail-closed rollout (recommended)
    Before merge, explicitly accept that legacy unscoped Daytona records need manual resolution and communicate the operator procedure.
  2. Define a legacy transition
    Pause merge until a safe transition policy preserves or deliberately retires existing Daytona lease records without granting cleanup authority from current configuration.

Technical review

Best possible solution:

Land the exact-ID and scope fencing only after maintainers explicitly accept the legacy-record cutover or provide a safe, operator-approved upgrade path that does not silently adopt resources under current credentials.

Do we have a high-confidence way to reproduce the issue?

Yes: the linked open issue provides a concrete lost-create fault scenario, and the added Worker regressions cover release, restart, retained-resource, and context-loss paths. This review did not execute the tests because the checkout is read-only.

Is this the best way to solve the issue?

Unclear: durable UUID publication and adapter-scoped ownership checks fit the provider-neutral architecture, but the intentionally incompatible legacy-record handling requires maintainer policy approval before it is the best release path.

Full review comments:

  • [P1] Resolve legacy Daytona leases before enforcing scope — worker/src/daytona.ts:158-168
    getOwnedServer rejects every persisted Daytona lease without providerScope; the added regression deliberately shows that even an otherwise active, same-context legacy lease then cannot refresh access or be deleted. This is a P1 upgrade break, so add an approved transition/operational path or record explicit maintainer acceptance of the fail-closed cutover before merge.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d024b182260d.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production owners are the Coordinator’s durable resource publication and Daytona’s scoped exact-resource cleanup. The supplied body reports an after-fix real Daytona/local-workerd run covering managed create and SSH use, original-context GET→DELETE→404 completion, context-mismatch rejection before provider I/O, and lost-response native expiry with preserved unresolved state; this is sufficient real-path evidence for the changed authority boundary.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (logs): The changed production owners are the Coordinator’s durable resource publication and Daytona’s scoped exact-resource cleanup. The supplied body reports an after-fix real Daytona/local-workerd run covering managed create and SSH use, original-context GET→DELETE→404 completion, context-mismatch rejection before provider I/O, and lost-response native expiry with preserved unresolved state; this is sufficient real-path evidence for the changed authority boundary.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on author.
  • remove merge-risk: 🚨 security-boundary: Current PR review merge-risk labels are merge-risk: 🚨 compatibility, merge-risk: 🚨 availability.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P1: An upgrade can stop cleanup and access refresh for existing managed Daytona leases.
  • merge-risk: 🚨 compatibility: Legacy persisted Daytona records lack the new provider scope required by cleanup.
  • merge-risk: 🚨 availability: A legacy active lease can no longer refresh access or complete automated cleanup after deployment.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (logs): The changed production owners are the Coordinator’s durable resource publication and Daytona’s scoped exact-resource cleanup. The supplied body reports an after-fix real Daytona/local-workerd run covering managed create and SSH use, original-context GET→DELETE→404 completion, context-mismatch rejection before provider I/O, and lost-response native expiry with preserved unresolved state; this is sufficient real-path evidence for the changed authority boundary.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owners are the Coordinator’s durable resource publication and Daytona’s scoped exact-resource cleanup. The supplied body reports an after-fix real Daytona/local-workerd run covering managed create and SSH use, original-context GET→DELETE→404 completion, context-mismatch rejection before provider I/O, and lost-response native expiry with preserved unresolved state; this is sufficient real-path evidence for the changed authority boundary.

Evidence

What I checked:

  • Introduced lifecycle ownership change: The verified PR delta adds early resource-claim publication before readiness, so an acknowledged UUID is durable across release or restart races. (worker/src/fleet.ts:3277, 029b4c28a46c)
  • Authority boundary implementation: Cleanup validates a UUID-shaped claim and requires the persisted scope to match the currently configured Daytona context before provider I/O. (worker/src/daytona.ts:158, 029b4c28a46c)
  • Legacy-upgrade behavior is explicit: The added regression test deletes providerScope from an otherwise active Daytona lease, then verifies release leaves cleanup unresolved and makes no provider requests even after the original configuration is restored. (worker/test/fleet.test.ts:11142, 029b4c28a46c)
  • Documented operational impact: The added lifecycle documentation states that legacy records without scope and changed credentials require operator resolution. (docs/features/lifecycle-cleanup.md:117, 029b4c28a46c)
  • Feature history: Daytona brokered fallback work appears to originate with Vincent Koc’s July 31 Daytona hardening commit, while Peter Steinberger recently maintained the provider ownership-fencing path and Jason (Json) authored the canceled-create cleanup work. (worker/src/daytona.ts:149, 7fe1f9334e16)
  • Real behavior proof supplied: The supplied PR body describes a real Daytona create/use/delete run, context-mismatch zero-I/O cases, and an observed exact-ID 404 after native expiry; it also states that the final head’s Worker tree is byte-identical to the live-tested implementation commit. (029b4c28a46c)

Likely related people:

  • vincentkoc: Feature history identifies the brokered Daytona hardening path as introduced in the July 31 Daytona work. (role: original Daytona lifecycle contributor; confidence: high; commits: 7fe1f9334e16; files: worker/src/daytona.ts, worker/src/fleet.ts)
  • steipete: Recent main history includes the exact-ownership fencing work that this patch extends across Daytona cleanup. (role: recent provider ownership-boundary contributor; confidence: high; commits: 1c1a0222a8f1; files: worker/src/fleet.ts, worker/src/daytona.ts)
  • Jason (Json): The current coordinator lifecycle path builds on the canceled-create orphan-prevention work. (role: canceled-create cleanup contributor; confidence: high; commits: e16d2481456c; files: worker/src/fleet.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the maintainer decision for the legacy unscoped-lease cutover, including the operator resolution path or a safe transition design.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-28T19:22:01.222Z sha 21bc20c :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-28T19:34:57.056Z sha 21bc20c :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 28, 2026
Record exact resource identity before readiness, preserve unresolved cleanup across lifecycle transitions, and bind destructive operations to the original provider context. Request native TTL and verify a fixed remaining deadline without assuming atomic creation timestamps.
@steipete
steipete force-pushed the steipete/daytona-managed-uncertain-create branch from 21bc20c to 029b4c2 Compare August 28, 2026 20:19
@steipete
steipete marked this pull request as ready for review August 28, 2026 20:24
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer decision and land-ready proof

Approved: use the documented fail-closed cutover for legacy unscoped Daytona leases and changed credentials, including same-organization key rotation. This decision was explicitly accepted in the task before implementation. It resolves the remaining P1 policy question and rank-up move in the latest review; it is not a request to invent an automatic migration or adopt resources under current credentials.

Operator path: finish outstanding cleanup in the original context before upgrading/rotating when possible. Inspect unresolved records with crabbox admin lease-audit. A scoped record can be retried with ordinary stop after restoring its exact original context. An unscoped historical record instead needs operator-confirmed resolution of the exact resource in its original Daytona account using provider controls; do not backfill scope or adopt name/label matches. Native TTL applies only to new allocations, not retrospectively to old sandboxes. No production legacy resource was inspected or deleted under this task's test-only allocation authority.

The legacy transition is now additionally verified with real workerd and persistent SQLite Durable Objects: byte-verified stable v0.47.0 source created an unscoped managed lease through public authenticated POST; the current Worker reopened the same store, retained its exact UUID and explicit unresolved cleanup after release, and retained that state across another restart. Current-runtime provider calls: 0. The old transport's three responses were synthetic; there were no credentials, external egress, cloud allocations, or direct database writes. This is real-runtime/store-upgrade proof, not a claim about a historical hosted engine or production account.

Final head: 029b4c28a46c3d5a1d26eeec6efb9630bbe6caab. All 20 relevant gates passed, none skipped: CI, connector smokes, docs proof, mandatory Release Check, and CodeQL. Fresh restricted pre-land Codex autoreview reported no actionable P0 findings. Focused local tests passed 754; the full Worker suite passed 1,634 with 3 explicit skips. Exact commands and the production/test LOC split are in the PR body.

The separate real-provider proof completed managed create, real SSH use, unauthorized caller/context rejection before provider I/O, original-context managed GET → DELETE → 404 cleanup, lost-response persistence through release/restart, and native expiry without any coordinator provider calls after the lost create. All three authorized task sandboxes are confirmed gone; the successful retry used no emergency deletion. The final Worker tree is identical to the live-tested implementation. No further allocation, tagged release, or package publication is authorized or needed.

@steipete
steipete merged commit 299faee into main Aug 28, 2026
30 of 31 checks passed
@steipete
steipete deleted the steipete/daytona-managed-uncertain-create branch August 28, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P1 Urgent regression or broken agent/channel workflow affecting real users now. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Managed Daytona loses cleanup after an unacknowledged create

1 participant