Repository navigation
feat(executor): region-qualified model prefixes and -auto/ qualifier - #311
Merged
Merged
Conversation
caigee-cmd
requested changes
Oct 19, 2026
caigee-cmd
left a comment
Owner
There was a problem hiding this comment.
感谢提交!显式区域前缀(workbuddy-cn/、workbuddy-gl/)以及 -auto/ 这个思路很好,把区域贯穿到路由循环(WithRegionFilter)、同时仍分别校验 key 授权和区域这一点也处理得很清楚。
合并前需要调整的核心问题:
- 不带区域的前缀(
qoder/、workbuddy/)不能默认锁定为 cn。很多用户只有国际账号,合并后他们现有的qoder/xxx和workbuddy/xxx请求会直接找不到可用账号,属于破坏性变更。请保持不带区域的前缀行为不变,继续自动选区;-cn/和-gl/只作为可选的显式限定。具体来说就是去掉defaultRegionForProvider,或者让它默认为空。 - 这样一来
-auto/和不带区域的前缀行为一致。可以保留它作为显式写法,也可以删掉以减少概念,两种都可以接受,请在 PR 描述里说明你的选择。 - 请把
compat_test.go、s01_protocol_contract_test.go、regression_test.go中因默认 cn 而改动的预期恢复原样,并补一个用例:只有国际账号时,qoder/model仍能路由成功。 - 请同步更新 changelog 片段中关于默认 cn 的描述,并 rebase 到最新 main。
改完后 @ 我一下即可,谢谢!
…/, workbuddy-gl/) - ResolveProviderFilter now returns (provider, region); the parsed region is applied as a region filter on the request context - ProviderPrefix recognizes dash-suffixed region qualifiers; NormalizeRegion maps the shorthand "gl" to global - changelog fragment (bilingual)
…egion A bare provider prefix (qoder/, workbuddy/) now defaults to the CN region, so a client that wants cross-region load spreading within one provider had no way to say it. The new -auto/ form (qoder-auto/…, workbuddy-auto/…) pins the provider family while keeping the region unqualified, which triggers the pool's automatic region selection and reuses its session-affinity latch so a route sticks to one region until it thins out.
One bilingual fragment per PR, per changelog/unreleased/README.md.
Add the WithRegionFilter/regionFilterFromContext context helpers and let newRouteLoop prefer an explicit model-name region over key-grant and pin-derived regions. These helpers were previously introduced alongside an unrelated quota change; they belong with the region-qualified prefix feature.
Per review on caigee-cmd#311: a bare prefix (qoder/, workbuddy/) must not default to cn — international-only deployments would lose all routes. The default-cn commit is dropped; bare prefix and -auto/ now behave identically (provider pinned, region chosen by the pool), with -cn/ and -gl/ as the optional explicit qualifiers. The compat/s01/regression test expectations return to their original form as a result. New coverage: TestPickRouteBarePrefixMatchesGlobalOnlyPool (global-only pool routes a bare qoder/ request; explicit -cn/ does not) and TestPrepareBarePrefixSetsNoRegionFilter.
favoroo
force-pushed
the
feat/executor-region-prefix
branch
from
October 19, 2026 04:51
46e54d9 to
79839f0
Compare
Contributor
Author
|
@caigee-cmd 已按 review 调整完毕:
麻烦再看一下,谢谢! |
caigee-cmd
approved these changes
Oct 19, 2026
caigee-cmd
left a comment
Owner
There was a problem hiding this comment.
LGTM. Bare prefixes keep auto region selection; -cn/-gl/-auto work as documented; tests and changelog updated. Merging.
This was referenced Oct 19, 2026
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
Adds explicit region control over model-name prefixes for multi-region providers (WorkBuddy, Qoder).
workbuddy-cn/model/workbuddy-gl/modelroute to CN or Global accounts.qoder/…,workbuddy/…) is unchanged: no region is pinned and the pool auto-picks across regions, so international-only deployments keep working.-auto/qualifier (qoder-auto/…,workbuddy-auto/…): kept as an explicit spelling of the bare-prefix behavior (provider pinned, region auto-picked, session-affinity latch reused). Chosen over deleting it so users can write the intent explicitly; it is documented as equivalent to the bare prefix.WithRegionFilter), overriding key-grant and pin-derived regions while still enforcing both filters independently.Review follow-ups (2026-10-19)
defaultRegionForProvideris gone); bare prefix and-auto/are now equivalent.compat_test.go,s01_protocol_contract_test.go,regression_test.goexpectations are back to their original form.TestPickRouteBarePrefixMatchesGlobalOnlyPool(a global-only pool still routes a bareqoder/model; an explicit-cn/pin does not match it) andTestPrepareBarePrefixSetsNoRegionFilter.main.Tests
go build ./...,go vet ./...,go test ./...,git diff --check