feat: add qoder client support (bili qoder) - #654
ranxianglei wants to merge 1 commit into
Conversation
📦 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. |
|
解决冲突 |
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
f3c7a1d to
ba5377c
Compare
[bot] 🏷 Conflicts resolved — branch rebased onto current master ( The conflict was a single one: the Post-rebase pre-flight (all on the new commit):
One minor finding from the diff review (reporting only, no separate change): if a user sets 中文摘要:已把 PR 分支 rebase 到最新 master(v0.1.102),唯一冲突是 launcher.ts 的 import 行(master 的 resolveCodexHome 与 qoder 新增导入取并集),rebase 后 typecheck / 全量测试(1337 通过 0 失败)/ build 全部通过并强推,PR 现已可合并;另发现一个仅影响"自定义端口 model server host"的小问题(MITM 白名单带端口导致匹配不上、静默退化为盲隧道),已在上方说明,可按需补一行修复。 |
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