Skip to content

feat: add qoder client support (bili qoder) - #654

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-09-09_qoder-client-support
Open

feat: add qoder client support (bili qoder)#654
ranxianglei wants to merge 1 commit into
masterfrom
2026-09-09_qoder-client-support

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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 honors HTTPS_PROXY and NODE_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 the QODER_ vs QODERCN_ env prefix family — issue open question 4), resolveQoderHome() (QODER_CONFIG_DIR/QODERCN_CONFIG_DIR > *_CLI_HOME + dir name > ~/.qoder / ~/.qoder-cn), readQoderConfig() (read-only settings.json model discovery + QODER_MODEL_SERVER_HOST), QODER_DEFAULT_MODEL_HOSTS (prod + regional US/SG/JP + CN gateway; daily/test excluded).
  • src/launcher.ts: bili qoder in LAUNCH_CLIENTS; discoverRoutes qoder branch (default model hosts whitelisted for MITM, QODER_MODEL_SERVER_HOST replaces 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=http forced (default transport is a server feature gate whose legacy fallback wire is unverified — issue open question 1); REQ: codex 压缩预算协调 + 匿名代理模式拦截伪造(根本解决方案) #321 budget alignment via resolveQoderBudgetEnv()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); resolveClientCommand qoderqodercli fallback; BILI_LAUNCHER_DIRECT warning.
  • src/discover.ts: qoder hosts in MITM domain auto-discovery + settings.json mtime watch.
  • src/cli.ts / README / AGENTS.md: help + docs.
  • Tests: 13 new (site detection, home resolution, config discovery, route discovery, env build, budget alignment, command resolution, full runLaunch integration).

v1 limitations (documented in code + issue)

  1. QODER_MODEL_TRANSPORT=http is forced — the legacy fallback wire is unverified on a real machine; revisit after verification (open question 1).
  2. CN-site detection: with BOTH intl and CN packages installed, a CN launch is detected as intl (degrades to no budget injection / intl-prefix transport env — never breaks the launch). QODERCLI_SITE=cn overrides.
  3. No MCP injection (proxy mode only; QODER_MCP_CONFIG compatibility unverified).
  4. Model window is server-driven and qoder model names are usually absent from bili's limits / models.dev registry — budget alignment is best-effort; the user's own QODER_AUTOCOMPACT_WINDOW remains the fallback (open question 3).

Pre-flight

  • npm run typecheck
  • npm test 1246/1247 — the single failure (resolveClientCommand: codex/claude resolve to themselves) is environmental and pre-existing: this sandbox has /usr/bin/codex installed; verified identical failure on clean master via git stash (passes on CI).
  • npm run build ✓; built CLI --help smoke-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/completions through the OpenAI pipeline, bili: qoder budget aligned — QODER_AUTOCOMPACT_WINDOW=... log, compression loop triggers.

Fixes #653

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
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

📦 Built Package Artifact

Branch: 2026-09-09_qoder-client-support (f3c7a1d)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-654

Each push to this PR publishes a new version under the pr-654 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr654.tgz
npm install -g package

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Reviewing PR #654 (qoder client support) now — checking out the branch, reading the full diff, and re-running pre-flight (typecheck / test / build). Will follow up with findings.

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.

feat: 新增 qoder 客户端支持(bili qoder)

1 participant