Repository navigation
Never point a non-production Cloud machine's edge at production coderouter - #18313
Merged
Merged
Conversation
…als name the signing key id
…oderouter Dev backends sign machine credentials with their own key (dev-backend-1) but set no CMUX_CODEROUTER_EDGE_ORIGIN, so resolveEdgeOrigin sent their Freestyle machines to coderouter.dev. Production refuses every such request (signed_unverified), and the machines keep polling it for life, also after their dev stack stops: the bulk of the reflection 401 flood. Without an explicit origin, only production defaults to coderouter.dev and previews to their branch URL; other deployments provision no rule. Refused signed tokens now name their unverified key id on the span.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 seconds. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
|
Merge receipt for |
rustybret
pushed a commit
to rustybret/bmux
that referenced
this pull request
Oct 7, 2026
d5bec00 fix: repaint Codex sessions after pane reattachment (manaflow-ai#18283) df3e34c fix(cloud): resolve 0.65.0 dogfood papercuts (manaflow-ai#18292) 7a5ff86 fix(cloud): restore from a snapshot with a stopped daemon supervisor (manaflow-ai#18320) bf0d292 Fix crash when a focused SwiftUI view outlives its hosting view (manaflow-ai#18250) 6b02ff8 feat(gh-merge-green): --revert rolls back a merged PR in one command (manaflow-ai#18312) 3cab11d Never point a non-production Cloud machine's edge at production coderouter (manaflow-ai#18313) 5df12be fix: let Claude Teams launch with integration disabled (manaflow-ai#18276) # Conflicts: # .github/workflows/ci-guards.yml
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.
The reflection 401 flood (~41k per 30 min, 2.0M on 2026-10-06) is not credential expiry. After #18307 deployed, every refusal on
/api/vm/reflection/namereportscmux.coderouter.auth_failure_detail = signed_unverified(4,138 in 3 min, 0not_live): the edge injects a signedx-cmux-authorizationthat production cannot verify.Cause: dev-backend stacks sign machine credentials with their own key (
CMUX_VM_AUTH_SIGNING_KEY_ID=dev-backend-1in the curated dev env) and set noCMUX_CODEROUTER_EDGE_ORIGIN, soresolveEdgeOriginfell back tohttps://coderouter.dev. Every Freestyle machine a dev stack creates (same Freestyle account) therefore sends its reflection, resource-usage and model traffic to production with a token production refuses, for the machine's whole life, also after its dev stack is stopped or purged (299 registered stacks). The guest retries the refusal every 8 s (#18308 fixes that for new snapshots).Fix: without an explicit origin, only production defaults to
coderouter.devand a Vercel preview to its branch URL. Any other deployment provisions no edge rule and mints no token, with a warning namingCMUX_CODEROUTER_EDGE_ORIGIN. Production can verify neither a dev key nor a dev database row, and the Freestyle edge cannot reach the private dev host, so such a rule could never work. A guest with no rule gets a DNS failure forreflection.cmux.internaland never reaches production.Diagnostics: a refused signed token now records its unverified key id (
cmux.coderouter.auth_key_id) andsigned_unknown_keywhen this deployment holds no such key, so the remaining traffic from already-running dev machines can be confirmed and counted in Axiom.Red/green on cmux-lawrence-2:
tests/coderouter-vm-model-plane.test.tsandtests/coderouter-request-telemetry.test.tsfail at e0bbc24, pass at head. Everycoderouter*,vm-reflection*,vm-principal*,vm-model*,vm-freestyle-provider*,vm-create*,vm-route-workflow*test file passes individually. Typecheck, complexity gate and eslint pass (two pre-existing unused-import warnings in the model-plane test).Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Stops dev and local deployments from wiring their machines' edge to production coderouter, ending the reflection 401 flood caused by production refusing tokens signed with dev keys.
Previously any deployment without
CMUX_CODEROUTER_EDGE_ORIGINdefaulted tocoderouter.dev, so every machine a dev backend created dialed production with a token it cannot verify, forever. Now only production defaults tocoderouter.devand Vercel previews to their branch URL; other deployments provision no edge rule and mint no token, with a warning naming the env var.Diagnostics
cmux.coderouter.auth_key_id) and a newsigned_unknown_keydetail when the deployment holds no such key.Written for commit 98dabbb. Summary will update on new commits.
Note
Medium Risk
Changes VM create provisioning and edge-origin defaults (fewer rules on dev stacks); production and preview behavior is preserved, but misconfigured
CMUX_CODEROUTER_EDGE_ORIGINcould leave machines unwired.Overview
Stops dev/local Cloud VM creates from installing Freestyle edge rules that forward guest traffic to production
coderouter.devwhen the stack signs VM JWTs with its own key and DB—those requests were failing assigned_unverifiedand flooding reflection 401s.Model plane:
resolveEdgeOriginnow returnsnulloutside production and Vercel preview unlessCMUX_CODEROUTER_EDGE_ORIGINis set;provisionVmModelPlanethen skips token minting and returns no edge rules (with a console warning). Production still defaults tocoderouter.dev; previews still use the branch URL.Auth telemetry: Refused signed
x-cmux-authorizationtokens record the unverified JWTkidon the span (cmux.coderouter.auth_key_id) and use a new detailsigned_unknown_keywhen this deployment does not hold that signing key, viaunverifiedVmAuthorizationKeyId/isKnownVmAuthorizationKeyandsignedRefusalin route token auth.Docs and tests cover the unwired non-prod path and the unknown-key diagnostic.
Reviewed by Cursor Bugbot for commit 98dabbb. Bugbot is set up for automated code reviews on this repo. Configure here.