Repository navigation
fix(relay): gate the Asia canary on Asia-targeted region fallbacks only - #24320
Conversation
…nary baseline Claude-Session: ced32ebb-7155-4413-adad-1eccd14c2010
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Production canary gate rekeyed to Asia-targeted fallbacks —
runtimeMetricsnow derivesasiaRegionFallbacksfromregionFallbacksDelta['asia-east2'], and the production canary fails only when that count is non-zero; US-targeted fallbacks remain recorded but ungated. - Staging gate preserved —
assertPassingRuntimeMetricsdropped itsexpectedRegionFallbacksparameter, with staging asserting its one intentionalus-central1fallback inline (identical behavior). - Regression test added — mirrors C31's real trial: 144 US-targeted fallbacks pass and are recorded, a single Asia-targeted fallback throws.
- Docs updated —
relay-workflows.mdexplains the target-region keying and the Asia-only gate.
The mechanism holds up against the producer: relay-observability.ts:268 keys regionFallbacks by target region, and app.ts:406 marks a fresh unhinted dial on an existing Asia pin as a us-central1-keyed fallback even when sticky assignment succeeds, so the US-aimed baseline is genuinely independent of a new Asia cell. Verification: node --test cloud/dev/scripts/relay-asia-rollout-evidence.test.mjs — 37/37 pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 Walkthrough📝 WalkthroughPriority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The canary records US-targeted fallbacks without failing and rejects Asia-targeted fallbacks; staging retains its exact-count checks. No actionable merge risk remains beyond normal CI. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
…nary baseline Claude-Session: ced32ebb-7155-4413-adad-1eccd14c2010
|
| // Fallbacks are keyed by the host's target region. US-targeted ones come from unhinted or | ||
| // US-preferring hosts an Asia cell cannot cause, so they are recorded but not gated. | ||
| if (number(metrics.asiaRegionFallbacks, 'asiaRegionFallbacks') !== 0) { | ||
| throw new Error(`${canary.label} canary asiaRegionFallbacks must be zero`) | ||
| } |
There was a problem hiding this comment.
When US cells lack placement headroom, ordinary placement can put a US-targeted or unhinted host on a general Asia cell. That fallback is counted under us-central1, even if the newly promoted canary cell serves the host. This gate ignores it, so the canary can pass while promotion increases cross-region US placements.

ELI5
Before a new Asia relay cell starts taking users, the rollout runs a five-minute trial and checks that nothing went wrong. One check was "no host was placed outside the region it asked for." That count is never zero in production, for reasons that have nothing to do with the new cell, so the trial could not pass. This change makes the check look only at the hosts a new Asia cell could actually affect.
What Changed
Before: promoting
production-gce-c31ran a real five-minute trial that worked. Its own test connection landed on C31, and C31 picked up 18 real hosts. The rollout still failed withC31 canary regionFallbacks did not match the intentional probesand put C31 back to migration-only. Any new Asia cell would fail the same way.After: the production trial fails if any host that asked for Asia was placed outside Asia. Fallbacks for hosts that asked for the US, or sent no region and so default to the US, are still counted. They are written into the evidence file but no longer fail the trial. Staging keeps its exact rule of one intentional fallback.
Mechanism: the director counts fallbacks by the region the host was aiming for, not the region it landed in. In production every fallback was aimed at
us-central1. These are placement-lane requests from unhinted or US-preferring hosts. An Asia cell cannot cause them, so they are recorded but not gated. The evidence script now also recordsasiaRegionFallbacksand gates on that number alone. All other gates are unchanged: unavailable regions, Asia selections, SQL failures, pool waits, and the check that the test connection landed on the new cell.Measured with the workflow's own log query:
Why
Three alternatives were considered.
Linked Issue
Fixes #N/A. This is an internal rollout gate fix with no issue.
Visual Proof
N/A. This changes a deploy workflow's evidence script and docs, with no UI.
Testing
node --testpasses on the evidence script tests, the Asia topology and admission tests, and the tests that pin the relay workflows doc.A new test copies C31's trial: US-aimed fallbacks pass and are recorded, and one Asia-aimed fallback fails.
Replay of the real trial logs from run 36830733912: the old script fails with the production error, and the new script passes. Every other gate still reads zero or stays within its bound.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Only the production rollout gate is affected. It has no runtime, SSH, mobile, or cross-platform impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)