Skip to content

fix(infra): attach the computer to an existing sandbox session class - #320

Merged
ian-pascoe merged 2 commits into
mainfrom
chore/computer-preview
Oct 21, 2026
Merged

ian-pascoe merged 2 commits into
mainfrom
chore/computer-preview

Conversation

@ian-pascoe

@ian-pascoe ian-pascoe commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Turning the sandbox's computer on (COMMISSARY_COMPUTER=on) for a stage that already has the SandboxSession class fails the deploy:

[State/SandboxSession-Containers] fail — BadRequest: {"error":"VALIDATE_INPUT","details":{"durable_objects":"Durable Object namespace is not Container-enabled"}}

Alchemy (2.0.0-beta.83, the latest) can create the class's container application before the State Worker's upload marks the existing namespace as Container-enabled. On a fresh stage this doesn't happen: the namespace doesn't exist yet, so the application waits for the Worker. Production and cloud both already have SandboxSession (#222), so turning the computer on there would fail the same way.

This adds a pnpm patch to alchemy's DurableObjectApplication provider. When Cloudflare answers "not Container-enabled", the provider keeps the reserved application name and doesn't fail, so the Worker uploads with the containers metadata. The next deploy then creates the application, because the provider's diff re-reconciles any application that isn't live.

Testing

  • On this PR's preview, first deployed without the computer, adding the preview-computer label failed exactly as shown above.
  • With the patch, the same preview deployed: [State/SandboxSession-Containers] created and [State] updated.

Follow-up

Report the ordering bug upstream to alchemy, and drop the patch once a release fixes it.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Preview pr-320 destroyed.

@ian-pascoe ian-pascoe changed the title chore: check the sandbox's computer on a preview fix(infra): attach the computer to an existing sandbox session class Oct 21, 2026
Alchemy creates a Durable Object class's container application before the
Worker upload that marks an existing namespace Container-enabled. So turning
the computer on for a stage that already has SandboxSession fails with
"Durable Object namespace is not Container-enabled". A patch to alchemy keeps
the reserved name and creates the application on the next deploy instead.
@ian-pascoe
ian-pascoe marked this pull request as ready for review October 21, 2026 19:41
@ian-pascoe
ian-pascoe merged commit 126fd30 into main Oct 21, 2026
11 checks passed
@ian-pascoe
ian-pascoe deleted the chore/computer-preview branch October 21, 2026 19:41

This branch was successfully deployed

1 active deployment
preview — 83582ceb Deployed Oct 21, 2026 by ian-pascoe via destroy preview #573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant