Make the rename deployable onto an existing Worker - #11
Merged
Conversation
Two things stood between the renamed suite and a deployment that already exists. Migration tags are an immutable contract. The rename rewrote the contents of v1_voice_demo, which Cloudflare has already recorded as applied on any deployed Worker: the tag would never re-run, the class would never be created under its new name, and the AbleDeskAgent binding would resolve to nothing. v1 is restored to the class as first created and the rename is expressed as a new v2_rename_desk_agent tag. A fresh install applies both and lands on AbleDeskAgent; a Worker that already applied v1 applies only v2 and keeps its Durable Object state. A Worker also cannot be renamed in place. A deployment already serving custom domains, an Access application and email routing from a Worker named before this rename should keep serving from it rather than moving all of that to a new name. ABLE_WORKER_NAME supplies the name the same way every other deployment coordinate is supplied, so the committed default stays "able" and nothing deployment-specific enters source. The name is validated as the DNS label it becomes: no leading or trailing hyphen, 63 characters at most.
codeyogi911
added a commit
that referenced
this pull request
Aug 7, 2026
#12) The committed Wrangler configuration gained comments in #11, but the production deploy path still read it with `JSON.parse`, so every `deploy:production` run failed before reaching Wrangler. - Parse the source with `jsonc-parser` (new dev dependency of `@able/desk`, per the package-first policy) and reject invalid or non-object JSONC. - Cover the committed `wrangler.jsonc` itself in the projection tests so the deploy path can never drift from the source format again, alongside an invalid-source rejection test. `npm run check` passes, and a local dry run of `build:production-config` produces a correct projection for a predecessor-named Worker. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Morrow Contributors <codeyogi911@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Two defects stood between the renamed suite and any deployment that already exists. Both were introduced or exposed by the Morrow → Able rename.
The rename rewrote an applied migration tag
v1_voice_demowas edited in place to declareAbleDeskAgent. Cloudflare records migration tags as applied, so on a Worker that already ranv1_voice_demothe tag would never re-run, the Durable Object class would never exist under its new name, and theAbleDeskAgentbinding would resolve to nothing.v1is restored to the class as first created, and the rename becomes a new tag:{ "tag": "v1_voice_demo", "new_sqlite_classes": ["AbleDeskVoiceDemoAgent"] }, { "tag": "v2_rename_desk_agent", "renamed_classes": [{ "from": "AbleDeskVoiceDemoAgent", "to": "AbleDeskAgent" }] }Correct in both directions: a fresh install applies both in sequence and lands on
AbleDeskAgent; a Worker that already appliedv1applies onlyv2and keeps its Durable Object state.A Worker cannot be renamed in place
A deployment already serving custom domains, a Cloudflare Access application and email routing from a Worker named before the rename should keep serving from it, rather than moving all of that to a differently named Worker.
ABLE_WORKER_NAMEsupplies the name exactly the wayABLE_D1_DATABASE_IDand its siblings already do, so the committed default staysableand nothing deployment-specific enters source. The Worker name is not customer-visible when custom domains front it.Verification
npm run check— 206 + 4 tests pass, all typechecks cleancreateProductionConfigseam: default name preserved, override applied, blank ignored, source not mutated, and invalid names rejected🤖 Generated with Claude Code