Skip to content

Support Command Code (commandcode.ai CLI) — BYOK /bili/ works today; gateway wire + native seams for a fuller lane #5995

Open

Description

@seanfcx

Is your feature request related to a problem?

Yes. Command Code (the cmd CLI from commandcode.ai, Node-based harness, npm package @commandcode/harness) is not in the client support matrix, and today its official catalog/gateway models are silently never compressed: per docs/clients.md #1290, the gateway posts to a custom wire (/alpha/generate), which bili relays byte-for-byte as an unrecognized path. Only the Provider-plan endpoint (/provider/v1/chat/completions, a standard wire) is compressed. Users on the catalog models get no signal that compression never engages.

What already works today (no bili changes needed)

Command Code has a BYOK system (~/.commandcode/providers.json) with a per-provider baseURL and three declared wires (openai-completions / openai-responses / anthropic-messages). That fits the #2340 "adopting unlisted clients" route exactly: prepend http://127.0.0.1:8787/bili/ to a provider's baseURL, run bili start, and any BYOK model rides compression. Request: add Command Code to the #2340 verified-entry-points table (column: baseURL in ~/.commandcode/providers.json).

What a native lane could look like (seam inventory)

Command Code ships enough declarative surface for a zcode-style posture:

  • Provider store rewrite — providers.json is plain JSON with per-provider (and per-model) baseURL; same shape as the zcode provider-store rewrite (loopback targets skipped, "direct" exemptions, .bili-bak snapshot).
  • SessionStart hook — fires on startup/resume/clear, injects context only (non-blocking); good fit for the attach-or-spawn bootstrap MCP child, same as zcode's hooks.enabled + SessionStart hook.
  • stdio MCP servers — natively supported; the four ACP tools (compress / decompress / search_context / acp_status) register like any other MCP server.
  • Mods (ModApi) — a TypeScript plugin API (cmd.addProvider, event observers, lifecycle hooks, input interception). It is the same internal API Command Code's own built-in providers are written against, so an in-process seam (pi/dsh/opencode-style fetch patch or provider-transport override) may exist — worth an evaluation; I could not confirm request-level HTTP interception from the public docs alone.

Describe the solution you'd like

  1. Short term: document the BYOK /bili/ prefix path (one row in 客户端收养:剩余低成本可接入客户端(Crush / Zed / Continue / Cline 家族等) #2340's table), and/or a bili plugin install commandcode that does the providers.json rewrite + SessionStart hook + MCP entry (zcode posture).
  2. Open question: is recognizing the /alpha/generate gateway wire feasible/desirable, or does that need cooperation from Command Code itself? (If their Provider plan /provider/v1/chat/completions is the recommended BYOK-adjacent endpoint, maybe a docs note pointing catalog users there suffices.)

Context

Environment

  • OS: UOS 20 (deb-based), Arch: loongarch64
  • Node: v24.22.2
  • Command Code CLI: installed at ~/.local/opt/command-code

Activity

  1. ranxianglei commented on Nov 9, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    (ai: vllm-qwen/qwen3.8-27b)

    Duplicate screening: no exact duplicate; however, item 3 of this issue (compressing the /alpha/generate gateway wire) overlaps open #1295 — same mechanism (custom-wire model endpoints never enter compression). Per one-issue-per-mechanism policy I linked them instead of splitting anything; see also my note under #1295.

    Labels: command-code (new) · scope/wiring · p3 (+ needs-decision) — client-integration feature request, wiring scope, no availability impact (a working path exists today).

    What I verified

    1. BYOK path (your "what already works") — confirmed. Cross-checked against Command Code's public BYOK docs: ~/.commandcode/providers.json carries per-provider (and per-model) baseURL with the three declared wires (openai-completions / openai-responses / anthropic-messages); keys live separately in auth.json, so the file being edited never holds secrets. All three wires end in paths bili already recognizes (/chat/completions, /responses, /v1/messages), so prepending http://127.0.0.1:8787/bili/ to a provider's baseURL rides compression — exactly as you reported. Shipped as the doc row you asked for: PR #5997 (table row in en+zh, plus one note disambiguating BYOK vs catalog models; labeled documentation/scope/docs/p3).

    2. Your open question (gateway wire) — already answered by work in flight; no Command Code cooperation needed. This exact wall is what #1290 reported (Command Code plan traffic → /alpha/generate → zero compression); #1291 made it loud; and #1295 got owner approval (2026-09-26) and is implemented in PR #1444 — still open, awaiting merge (verified live just now; the symbols are absent from current master). It adds a declarable custom-wire config plus a first new wire family commandcode, built from the endpoint's real envelope+JSONL contract. Once merged and released, one config line compresses catalog models:

    "modelEndpointPatterns": [{ "match": "https://api.commandcode.ai/alpha/generate", "wire": "commandcode" }]

    So: feasible, already built, waiting only on the owner merging #1444. Nothing new to file — #1295 owns it.

    3. Native-lane seams — assessed; decision requested in my next comment. The providers.json rewrite is feasible (plain JSON, same pattern as the zcode store rewrite: loopback targets skipped, .bili-bak snapshot). SessionStart hook + stdio MCP are documented surfaces that fit the zcode bootstrap posture. One useful observation: the zcode posture does not require ModApi-level interception — it works entirely through declarative seams, so the lane design stays open even though request-level HTTP interception from ModApi remains unconfirmed. Cost class ≈ the zcode module (four source files) plus ongoing maintenance across their releases (their BYOK is explicitly Beta — the schema can move). Options with costs are in the decision comment below.

    Status: duplicate screening done · labels applied · doc row shipped (PR #5997, CI pending) · wire question routed to #1295/#1444 · native lane parked as needs-decision.

  2. ranxianglei commented on Nov 9, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    🔶 需要决策

    Background (one line): Command Code's BYOK path is now documented (PR #5997) and its catalog-model compression gap is already fixed but unmerged (#1295 → PR #1444); what remains is whether to build a native lane for this client.

    Pending decision: build a bili plugin install commandcode lane (zcode-style: providers.json rewrite + SessionStart hook + stdio MCP entry)?

    Options (each with cost):

    • A. Docs only (default) — what PR [PR] docs(clients): add Command Code BYOK entry point to verified-entry-points table (#5995) #5997 already ships. Users do one manual edit per provider (baseURL prefix) for BYOK compression. Cost: ~0. Remaining gap: hand-edit once per provider; catalog models still need [PR] feat: declarable custom-wire model endpoints + commandcode-cli wire family (#1295) #1444 merged regardless of this choice.
    • B. Full zcode-style native lane — new src/commandcode/ module at zcode scale (~4 files: store rewrite with loopback-skip + .bili-bak snapshot, SessionStart bootstrap hook, stdio MCP entry exposing the four ACP tools, watchdog), plus route-policy config knobs (a Configuration-Surface report would be required before building them), plus ongoing maintenance across their releases — their BYOK is explicitly Beta upstream, so the schema can move under us (the zcode lane alone has absorbed signing-block regressions across releases). It cannot be e2e-tested in CI (external CLI); pre-work = install cmd in a disposable workspace and capture real provider/hook/MCP traffic to pin the exact contracts. Value: zero-config BYOK compression + session-bound native ACP tools; makes it the 10th maintained client lane in a fleet that already carries nine.
    • C. Minimal rewrite only (providers.json routing, no hook/MCP) — roughly half of B's cost, but delivers compression without native tools or session binding, breaking the three-mode alignment every other lane follows; it would just be topped up into B later. Not recommended on its own.

    My recommendation: A now; revisit B only after #1444 merges (a lane would have to declare modelEndpointPatterns anyway to help catalog models) and against real-CLI verification, ideally driven by continued demand from actual users. Rationale: the highest-value gap (catalog models) is solved by #1444 regardless of lane shape; BYOK compression works today with one documented edit; building a maintained lane on a beta upstream schema risks rework; and the reporter themselves frames the lane as "worth an evaluation" with the ModApi seam unconfirmed.

    Default behavior if undecided: stay at A — PR #5997 ships the doc row, no lane code starts, thread stays labeled needs-decision.

    结构化八问(供评审):

    1. 是什么问题:用户希望更完整地支持 Command Code——其 BYOK 模型今天就能压缩但无文档指引,原生车道(零配置 + 原生 ACP 工具)尚不存在;catalog 模型零压缩是另一条已单独立项的缺口([Feature] Declarable custom-wire model endpoints — route providers like commandcode's Go plan (/alpha/generate) into compression #1295)。
    2. 什么原因导致的:该客户端没有对应车道——纯缺失,不是缺陷;catalog 侧缺口的根因(两处硬编码路径表 + 封闭 wire 族枚举)已在 [PR] feat: declarable custom-wire model endpoints + commandcode-cli wire family (#1295) #1444 修复待合并。
    3. 影响范围与严重程度(按选项):A——仅影响 Command Code 用户,可发现性/体验级,有文档化绕行;B——为所有未来 commandcode 用户引入新面,新增失败模式(第三方文件改写风险由快照+校验缓解、上游 Beta schema 漂移),做扎实则低-中;C——同 B 的写盘风险但少了工具与会话绑定,价值/成本比最差。
    4. 怎么修复的(推荐选项思路):文档先行(已交付,PR [PR] docs(clients): add Command Code BYOK entry point to verified-entry-points table (#5995) #5997);车道工作缓建;重审时的前置工作 = 一次性工作区安装 cmd,抓真实流量钉死 providers.json/hook/MCP 契约,再按 zcode 规模实现(fixture JSON 单测,CI 跑不了外部 CLI)。
    5. 是否有回归问题(按选项):A——无(docs-only diff,共 4 行);B——只触碰新文件 + CLI 子命令注册,但新增配置键(owner 门禁面)且成为第三方文件的写入方(必须遵守 parse-guard + 快照纪律,绝不静默覆盖用户配置);C——同样的写盘风险,价值更少。
    6. 是否破坏缓存:不涉及(A);B——新会话按客户端会话身份建键,不改变既有缓存/重试/游标行为。
    7. 是否改了设计方向:A——无;B/C——新增第 10 条维护中的客户端车道(架构同型,边界不变);ModApi 进程内拦截明确不在范围内,除非真实 CLI 验证证明必要。
    8. 是否引入了新的配置:A——无;B——路由策略类配置键(仿 zcode 风格,如 direct 前缀、退出开关)——实现前必须走 Configuration-Surface 报告 + owner 签核。
    Option Content Cost Risk Value gained
    A (recommended) Doc row + pointer (shipped, PR #5997) ~0 none discoverability of a working path
    B full native lane (zcode-style) new ~4-file module + config surface + standing maintenance upstream Beta schema drift; no CI e2e zero-config + native ACP tools (BYOK only until #1444)
    C rewrite only ~half of B same file-writer risk, no tools compression without session binding — inconsistent
  3. added a commit that references this issue on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions