Skip to content

fix(api): stop Cloudflare workers claiming provider_preference=any - #334

Merged
haasonsaas merged 1 commit into
mainfrom
fix/cloudflare-claim-filter
Aug 6, 2026
Merged

fix(api): stop Cloudflare workers claiming provider_preference=any#334
haasonsaas merged 1 commit into
mainfrom
fix/cloudflare-claim-filter

Conversation

@haasonsaas

Copy link
Copy Markdown
Contributor

Summary

Production Dex/chat runs failed with:

Cloudflare worker received a non-Cloudflare placement request

Cause

Claim matching treated provider_preference: any as compatible with every worker, including Cloudflare. CF workers advertise provision_sandbox, claimed generic development_container / ubuntu-dev jobs, then rejected them in the CF provider hard check.

Fix

worker_matches_provider_preference:

  • Any → only kubernetes workers
  • Kubernetes / Cloudflare → exact (case-insensitive) provider match

Test

  • cargo test -p sandboxwich-api provider_preference placement_match

Deploy

Promote a new sandboxwich-api image after merge so production claim routing picks this up.

`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.
@haasonsaas
haasonsaas merged commit 8070c45 into main Aug 6, 2026
4 of 6 checks passed
@haasonsaas
haasonsaas deleted the fix/cloudflare-claim-filter branch August 6, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant