Repository navigation
Conversation
Qoder's China deployment was reachable only by pointing the global Qoder OAuth env vars at qoder.cn, which conflated two accounts that must not race for the same slot. Add qoder-cn as its own registry entry with its own host, OAuth config and canonical provider row. The CN entry reuses the global executor and model catalog so a model added upstream lands on both sites, and the global entry stays byte-identical. Browser OAuth keeps the CN client credentials env-only (QODER_CN_OAUTH_*): an earlier revision embedded a literal client_id/client_secret for qoder.cn and cheaper-inference#7866 removed exactly that under Hard Rule cheaper-inference#11, so nothing is reintroduced. Includes the site resolver, the stable UUID v4 machine id ported from magpie's internal/qoder/endpoints.go, and unit coverage for both.
This branch has not been deployed
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.
What
Adds Qoder CN (
qoder.cn) as a first-class provider, with no change to the existing globalqoderentry.Previously the only way to reach the China deployment was to point the global Qoder OAuth env vars (
QODER_OAUTH_*) atqoder.cn. That conflated two separate accounts — a CN session and a global session could not both exist, and the model-scoped throttle work in flight (#18572) would see them as the same provider.Why a dedicated entry
qoder-cnis its own registry id, canonical provider row and OAuth config, so a CN account and a global account never race for the same connection.qoderProvider.modelsrather than copying the catalog; a model added upstream lands on both sites.qoderProvider(id,baseUrl, executor, headers) is byte-identical to before — asserted by a test.Security note (Hard Rule #11)
An earlier revision of
QODER_CONFIGembedded a literalclient_id/client_secretforqoder.cn; #7866 removed exactly that. This PR does not reintroduce it: the CN client credentials stay env-only (QODER_CN_OAUTH_CLIENT_ID/QODER_CN_OAUTH_CLIENT_SECRET), andQODER_CN_CONFIG.enabledisfalseunless both are provided. A regression test asserts the retired literals never reappear.Changes
open-sse/config/providers/registry/qoder/cn/index.tsqoder-cnentry onapi.qoder.cn, executorqoder, shared model catalogopen-sse/config/providers/index.tsqoder-cnsrc/lib/oauth/constants/oauth.tsQODER_CN_CONFIG(env-only,qoder.cnendpoints)src/lib/oauth/qoderSite.tsglobal/cn) and site headerssrc/lib/oauth/qoderMachineId.tssrc/shared/constants/providers/oauth.tsqoder-cnprovider rowtests/unit/qoder-cn-site.test.tsThe site resolver and machine id are ported from magpie's
internal/qoder/endpoints.go(SiteOf,NewMachineID), which documents that Qoder CN's CLI authenticates with the device token itself and keeps a stable machine id.Verification
node --import tsx/esm --test tests/unit/qoder-cn-site.test.ts→ 9/9 pass (written failing first:ERR_MODULE_NOT_FOUND)node --import tsx/esm --test tests/unit/qoder-oauth-config.test.ts→ 2/2 pass (the existing "Qoder defaults must not point to qoder.cn" guard still holds for the global config)node --import tsx scripts/check/check-provider-consistency.ts→OK — 296 REGISTRY, 381 canonical, 0 registry-onlytsc -p tsconfig.typecheck-core.json --noEmit→ cleaneslinton all touched files → cleanprettier --check→ cleantests/unit/qoder-executor.test.tsfails in this environment (spawn … qodercli ENOENT) both with and without this change — its stub is a#!/bin/shscript that Windows cannot execute. Pre-existing, not a regression.release/v3.8.53is currently red: #17219 ([free-catalog-evidence] tokenharbor/claude-haiku-5.5:free: missing evidence). Any CI failures traced to that issue are inherited, not caused here.