Skip to content

Rebuild container images when only their guest code changes - #177

Merged
tim-smart merged 1 commit into
mainfrom
agent/bob/b0597528f3f2
Nov 3, 2026
Merged

tim-smart merged 1 commit into
mainfrom
agent/bob/b0597528f3f2

Conversation

@tim-smart

@tim-smart tim-smart commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the 405 that attachFile gets from the chat sandbox.

Cause

The chat sandbox still runs the image built on 2026-10-28, so it has no GET /files route from #176. Every Deploy since then planned [ChatSandbox] noop and [PullRequestReviewSandbox] noop, even when guest code changed.

The cause is in Alchemy's container provider. An Effect-native container (main) carries its program as an Effect in props.exports. diff starts with if (!isResolved(news)) return, and that Effect always makes isResolved false. The engine then falls back to comparing props with Effects stripped. Those are equal, so the plan is noop, and the bundle hash never reaches the image comparison. 2.0.0-beta.85 and Alchemy main have the same code.

Fix

The Cloudflare patch now calls stripEffects(news) before that check, as the Worker provider already does. It covers both TypeScript and shipped JavaScript. patches/README.md documents it.

The earlier version of this PR added a container API handshake. That is gone: it misread the cause, and against the old image it would have restarted every warm sandbox.

Checking it

The first Deploy after merge should plan [ChatSandbox] update and [PullRequestReviewSandbox] update, then build and roll out both images. After that, attachFile should work in a new chat.

Closes EFF-3313

Alchemy's container diff returned early for every Effect-native container:
its props carry the program as an Effect in `exports`, so `isResolved` is
always false. The engine then planned noop, and the chat and PR review
sandbox images stayed on the 2026-10-28 build. The chat sandbox never got
the /files read route from #176, so attachFile got a 405.

Patch the Cloudflare provider to strip Effects before that check, as its
Worker provider already does.
@tim-smart
tim-smart force-pushed the agent/bob/b0597528f3f2 branch from af1fecf to 9f79ae9 Compare November 3, 2026 00:23
@tim-smart tim-smart changed the title Replace a warm chat sandbox that predates the Worker's container API Rebuild container images when only their guest code changes Nov 3, 2026
@tim-smart
tim-smart merged commit 8008936 into main Nov 3, 2026
4 checks passed
@tim-smart
tim-smart deleted the agent/bob/b0597528f3f2 branch November 3, 2026 00:31
@sam-goodwin

Copy link
Copy Markdown

patching on our end alchemy-run/alchemy#2971

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.

2 participants