fix(api): stop Cloudflare workers claiming provider_preference=any - #334
Merged
Conversation
`worker_matches_provider_preference` treated Any as matching every registered provider. Cloudflare workers advertise provision_sandbox, so they claimed generic development_container jobs and then hard-failed with "Cloudflare worker received a non-Cloudflare placement request". Any now means general-purpose kubernetes workers only; specialized providers require an explicit preference. Case-insensitive exact match for named preferences. Regression covered by unit tests on the claim matcher.
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.
Summary
Production Dex/chat runs failed with:
Cause
Claim matching treated
provider_preference: anyas compatible with every worker, including Cloudflare. CF workers advertiseprovision_sandbox, claimed genericdevelopment_container/ubuntu-devjobs, then rejected them in the CF provider hard check.Fix
worker_matches_provider_preference:Any→ onlykubernetesworkersKubernetes/Cloudflare→ exact (case-insensitive) provider matchTest
cargo test -p sandboxwich-api provider_preference placement_matchDeploy
Promote a new
sandboxwich-apiimage after merge so production claim routing picks this up.