Repository navigation
feat(examples): keep alchemy-cloudflare Durable Objects running on pending I/O - #53
Merged
Merged
Conversation
…nding I/O Move both Workers to compatibility date 2026-10-01. From that date, a pending call to another Durable Object, a container, `waitUntil` or a timer keeps a Durable Object in memory with no client connected, for up to 15 minutes per call. A turn waiting on a container command through the Computer is now covered without its HTTP client. Keepalive stays: pending I/O does not survive a deploy or crash, and its alarm is what wakes a cut-off session so it continues the turn. Its comments now say so, and drop the claim that outbound fetches did not count as activity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> HumanLayer-Session: https://app.dev.codelayer.gg/sessions/01a0f3fc-13b0-758f-a343-fae04e83a7a9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #52 (Effect 4.0.0 / Alchemy beta.80).
Cloudflare's pending I/O keep-alive change: from compatibility date
2026-10-01, pending calls to another Durable Object, service bindings,container.monitor(),waitUntiland timers keep a Durable Object in memory with no client connected. Each call is covered for up to 15 minutes. Outboundfetch()already was.Changes
Worker.tsandcomputer/ComputerWorker.tsmove from compatibility date2026-08-31to2026-10-01. The only other change in that range is Python 3.14 for Python Workers.Keepalivestays, with corrected comments. Pending I/O keeps a running turn in memory, but a deploy or crash still ends it.Keepalive's alarm is what wakes a cut-off session so it continues the turn. Its comment also claimed model fetches didn't count as activity, which was wrong: the real gap was the RPC call to the Computer.Deploy-only for now
Alchemy beta.80 passes the date straight through, so deploys work. Local
alchemy devrunsworkerd1.20260918.1, which probably refuses a later compatibility date until Alchemy pins a newerworkerd.Watch out: Alchemy beta.80's default stage changed
The default stage changed from
dev_${USER}tolive_${USER}. A plainalchemy deployon beta.80 therefore planned a whole new stack. It created a second ChatWorker, re-uploaded the fixed-name Computer Worker, and failed on the container app. I cleaned up as follows:livestage's record of the shared Computer Worker, without deleting the Worker;livestage, which deleted its ChatWorker and its stray container app;--stage dev_kylemistele.Existing deployments need
--stage dev_<user>orALCHEMY_STAGEfrom now on.Tested on Cloudflare
I deployed the
dev_kylemistelestage and sent a message whosebashcontainer command wassleep 240; echo finished-sleep. The HTTP client disconnected after 20 seconds. The command returnedfinished-sleepabout four minutes later and the turn completed, with no restart nudge in the log. Caveat: I polled the log every 30 seconds andKeepalive's alarm still runs, so this shows the turn survives a disconnected client, not the new rule on its own.Typecheck, lint, format and the example's 25 tests pass.
🤖 Generated with Claude Code