feat: add qoder client support (bili qoder) - #654
Open
ranxianglei wants to merge 1 commit into
Open
Conversation
qoder's model endpoint scheme is hardcoded https with no base-URL override env, so /bili/ rewrites cannot reach it — cert-MITM is the only route (qoder's built-in undici honors HTTPS_PROXY + NODE_EXTRA_CA_CERTS). - client-config: QoderConfig, qoderIsCnSite (QODERCLI_SITE / CN-prefixed envs / on-disk config dir), resolveQoderHome, readQoderConfig (settings.json model, QODER_MODEL_SERVER_HOST), QODER_DEFAULT_MODEL_HOSTS - launcher: bili qoder (proxy mode) — HTTPS_PROXY + NODE_EXTRA_CA_CERTS + BILLION_CONTEXT_PROXY, default model hosts whitelisted for MITM (or the QODER_MODEL_SERVER_HOST override), QODER_MODEL_TRANSPORT=http forced (legacy fallback wire unverified), #321 budget alignment via QODER_AUTOCOMPACT_WINDOW / QODERCN_AUTOCOMPACT_WINDOW, qoder/qodercli binary resolution - discover: qoder hosts in MITM domain auto-discovery - cli/README/AGENTS: help + docs Fixes #653
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-654Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr654.tgz
npm install -g packageThis comment is automatically updated on each push. |
Owner
Author
Open
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
bili qoder— qoder (Qoder CLI, npm@qoder-ai/qodercli/@qodercn-ai/qoderclicn) through the proxy, proxy mode (wire injection).qoder's model endpoint scheme is hardcoded https with no base-URL override env, so
/bili/rewrites cannot reach it — cert-MITM is the only route (verified from the v1.1.47 bundles: qoder's built-in undici honorsHTTPS_PROXYandNODE_EXTRA_CA_CERTS, which is additive, so the plain root CA suffices). OpenAI chat-completions wire → existing OpenAI compression pipeline.Changes
src/client-config.ts:QoderConfig,qoderIsCnSite()(CN-site detection rule for theQODER_vsQODERCN_env prefix family — issue open question 4),resolveQoderHome()(QODER_CONFIG_DIR/QODERCN_CONFIG_DIR>*_CLI_HOME+ dir name >~/.qoder/~/.qoder-cn),readQoderConfig()(read-onlysettings.jsonmodel discovery +QODER_MODEL_SERVER_HOST),QODER_DEFAULT_MODEL_HOSTS(prod + regional US/SG/JP + CN gateway; daily/test excluded).src/launcher.ts:bili qoderinLAUNCH_CLIENTS;discoverRoutesqoder branch (default model hosts whitelisted for MITM,QODER_MODEL_SERVER_HOSTreplaces them per qoder's own resolution order);buildQoderEnv()(HTTPS_PROXY+NODE_EXTRA_CA_CERTS+BILLION_CONTEXT_PROXY, inherited proxy vars fully stripped);QODER_MODEL_TRANSPORT=httpforced (default transport is a server feature gate whoselegacyfallback wire is unverified — issue open question 1); REQ: codex 压缩预算协调 + 匿名代理模式拦截伪造(根本解决方案) #321 budget alignment viaresolveQoderBudgetEnv()→QODER_AUTOCOMPACT_WINDOW/QODERCN_AUTOCOMPACT_WINDOW(caps the effective window, so injection is always safe; no injection when the user self-aligned or the window is unresolvable — qoder's catalog is server-driven);resolveClientCommandqoder→qoderclifallback;BILI_LAUNCHER_DIRECTwarning.src/discover.ts: qoder hosts in MITM domain auto-discovery +settings.jsonmtime watch.src/cli.ts/ README / AGENTS.md: help + docs.runLaunchintegration).v1 limitations (documented in code + issue)
QODER_MODEL_TRANSPORT=httpis forced — thelegacyfallback wire is unverified on a real machine; revisit after verification (open question 1).QODERCLI_SITE=cnoverrides.QODER_MCP_CONFIGcompatibility unverified).QODER_AUTOCOMPACT_WINDOWremains the fallback (open question 3).Pre-flight
npm run typecheck✓npm test1246/1247 — the single failure (resolveClientCommand: codex/claude resolve to themselves) is environmental and pre-existing: this sandbox has/usr/bin/codexinstalled; verified identical failure on clean master viagit stash(passes on CI).npm run build✓; built CLI--helpsmoke-tested (qoder lines render).Suggested real-machine verification (issue's first scenario): intl + PAT login,
bili qoder— model traffic TLS-terminated via the proxy,/model/v1/chat/completionsthrough the OpenAI pipeline,bili: qoder budget aligned — QODER_AUTOCOMPACT_WINDOW=...log, compression loop triggers.Fixes #653