Repository navigation
[PR] feat: declarable custom-wire model endpoints + commandcode-cli wire family (#1295) - #1444
ranxianglei wants to merge 7 commits into
Conversation
[bot] 🏷 Review started. Early finding: the PR base ( |
1cd7e6a to
56406c1
Compare
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9312-pr.1444.46f3cc9This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr1444.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review complete — PR rebased onto current master, all gates green, What I didThe PR base was 224 commits behind master and GitHub-marked unmergeable (dirty) — Conflict resolutions (10 hunks): 8 were import-list/adjacent-line unions (master added Doc fix (commit ① Direction vs original issue (#1295)Implements exactly the owner-approved plan: ② Regression inventory (existing behaviors on touched paths)
③ CodeStrict unwrap/rewrap fidelity holds up under scrutiny: unknown top-level keys and ④ TestsReal teeth, not ceremony: ⑤ Diff & gatesAfter rebase: exactly 22 files, +1898/−34 — every line serves the PR's purpose; no whitespace churn, no generated artifacts, no lockfile drift. 中文摘要:PR #1444(可声明自定义 model 端点 + commandcode wire 族)方向与 owner 批准的 #1295 方案一致、代码与测试质量过关;发现并直接修复了两处问题——基线落后 master 224 个提交导致的 10 处冲突(含一处 #1195 管线重构的语义性整合,已验证初始/preflight/overflow 三条路径全部经过 commandcode 打标点)和 WIRE-CONTRACTS 文档 WC-4 方向写反——已 rebase 到最新 master 并强推,本地+GitHub CI 全绿,可以合并。 |
Deep review (on top of 56406c1 → f5461db)Reviewed the full diff (two feat commits + docs) against #1295. Verdict: approve after the hardening commit below — architecture is right (single declaration source for both claim gates, strict-fidelity reject→verbatim-relay default, WC ledger, no pipeline changes for standard families). Fixed on the branch (f5461db)
Non-blocking observations
Gatestypecheck ✓ · targeted suites 107/107 (model-endpoints, commandcode wire/endpoint/adapter/plugin-pipe, plugin-agent, proxy-stream-error) · CI running remotely on f5461db. |
f5461db to
d44e333
Compare
[bot] 🏷 Hardening commit Verification of f5461db (independent re-check)
Fixed on the branch —
|
…ap before chain stamp; port commandcode error shape into nativeErrorChunk/legacyCompletionChunk
…ng args (anthropicCacheMarks, streamErrorShape) around the commandcode ternary
…export internal ModelEndpointWire Post-merge gate fixes on the merged tree: - config-surface-guard (#2643, landed after this branch cut): the new top-level field needed a seed entry in website/config-reference/*.yaml; added to server.yaml (upstream group) and regenerated the marked doc blocks via tools/gen-config-docs.mjs (hand-written section prose kept). - unused-exports: ModelEndpointWire is only used inside src/model-endpoints.ts — drop the leading export (INTERNAL_ONLY). Local: both gates green, tsc clean.
(ai: vllm-qwen/qwen3.8-27b) 查重: N/A —— 系统转发的「上游 PR 冲突」唤醒(本 PR 分支 vs master),不是新 issue 接单。 冲突已解决——结构化八问1. 是什么问题:分支自 9-26 停更,期间 master 走了 2692 个提交(最大动作是 #1440 把请求管线从 src/server.ts 拆进 src/server/*.ts 模块群),两侧改写了同一片文件区域,GitHub 判定不可合并(dirty),PR 卡住。 2. 什么原因导致的:不是代码缺陷,是长命分支与快进主干的漂移。master 侧把分类器/forward() 搬进了 handle.ts/relay.ts、把各原生 lane 的 bootstrap 重构为 armNative* 函数、新增 #1909 providers 表声明与 #2924 dsh 门控机制、给 TagEchoFilterStats 加了必填 dropCount 字段、上了两个新门禁(config-surface-guard / unused-exports);我们分支还在旧位置编辑同一逻辑 → 9 个文件 20 个 hunk 文本冲突。 3. 影响范围与严重程度:只影响本 PR 自身的可合并性,冲突解决本身不改变任何用户可见行为;卡住期间阻塞 #1295 的功能落地。现已解除。 4. 怎么修复的:把 master 合入分支(merge 而非 rebase,保留 PR 历史与既有评审记录),按「意图并集」解 9 文件冲突:PR 功能的完整增量(commandcode wire family + modelEndpointPatterns 声明机制,共 20 个 hunk)逐段重新落位到新家园(src/server/handle.ts 的分类器/unwrap/prepared.commandcode/preflight 错误面,src/server/relay.ts 的 rewrap/wireTransform/流错误/plugin JSONL 直管/适配器选择);agent 各 lane 采用 master 的 armNative* 结构 + PR 的声明加载调用点;dsh 的声明判定并入 master #2924 takeoverGate 顶部。随后一个跟进提交 cd55447 补上两个新门禁的集成债(config-reference 种子条目 + ModelEndpointWire 降为内部类型)。最后又追平两批零文件交集的 master 小差量(#3398/#3412 billing 修复、#3721 Windows teardown 重试、kernel EOF 换行),当前 head 8549b43 已完全同步 master 尖端 c398859。 5. 是否有回归问题:对 diff 触碰路径的既有行为逐项清点——全部有意变更且已在下方清单披露,无无意回归。验证证据:本地 typecheck/build/定向套件全绿(214 pass / 0 fail,覆盖 commandcode 四套件、model-endpoints、native-intercept、proxy-stream-error、dsh/omp/pi/opencode native);前一 head cd55447 的远程 CI 除下述 2 个既有红道外全部绿(含所有 e2e lane 与其余测试分片);最终 head 8549b43 push 后静态门禁全绿、测试矩阵运行中。 6. 是否破坏缓存:不涉及。持久化格式、会话键、压缩缓存策略均未动(零 kernel 改动)。 7. 是否改了设计方向:没有。合并完全跟随 master 的拆分管线架构,PR 功能是重新落位而非重设计。唯一一处集成级决策:分类器同时遇到「#1909 providers 表按路由声明」与「#1295 全局 modelEndpointPatterns 声明」时的优先级定为 URL pin > #1909 > #1295 > 内置启发式(路由特化压全局),已在 handle.ts 决策点注释固化理由。 8. 是否引入了新的配置:无新增。modelEndpointPatterns 本身是 PR 内容(CONFIGURATION.md 中英散文节由 PR 自带);本次仅按新门禁要求补了 config-reference 索引条目(生成器标记块内,散文未动)。 行为变更清单(旧→新,均为有意变更)
两条红道说明(均为既有问题,与本 PR 无关)
收工判定冲突清零:分支已与 master 尖端同步(head 8549b43,mergeable=True 无冲突),静态门禁全绿,测试矩阵运行中(若 Windows 分片再次命中已知 flake 见 #3725)。CI 转绿后此 PR 即可合并——合并操作在你这边(系统规则不允许我代合)。 |
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决并推送: 怎么解的:8 个文件、10 处 hunk,全部按「双方意图取并集」处理,无设计决策分歧:
验证: 八问:
判定:冲突已清,等 CI 绿即可由 owner 合并。 |
|
Rebased this branch onto current Why: this PR has been 1725 commits behind master with 11 conflicted files (
Verification on No features were added beyond what is here — nothing from the later wire work is bundled. |
(ai: opencode/qwen3.8-27b) Merge conflict resolved and pushed. I merged Conflicts: 11 files, all resolved:
Local verification (targeted; full suite is CI's job): Re: @suyeku1's #6032 suggestion — thanks for the analysis; the described operation matches what this branch needed. I performed the merge independently on this PR's own branch rather than adopting the cross-fork tree (external work wasn't verifiable without consuming it), so #6032 is now redundant — up to the owner whether to close it. Flag for reviewers (not fixed by me — layout decision, not a mechanical conflict fix): Live status right now: GitHub reports 结构化八问(中文)
收工判定:冲突已解并推送,PR 已恢复 mergeable;CI 在新 head 上运行中(当前 0 失败),转绿后即可由 owner 合并。 |
…s architecture-docs guard)
…(relative link + index/architecture lines) The ranxianglei#1444 feature branch polished these five lines after this PR's tip was cut: the wire-contracts ledger reference becomes a clickable relative link (the file lives next to configuration.md), the docs index row states the ledger's permanence rule, and the architecture source map carries the longer comments with adapter-commandcode.ts in position. Taking the ranxianglei#1444 versions verbatim makes this PR a superset of the feature branch, so either merge path offered in the PR body (merge tip into the feature branch, or replace its head) lands identical docs.
(ai: vllm-qwen/qwen3.8-27b) 合并前复核完成:对 review 期间顺手修的两个提交逐行核对,均按声称落地,本轮无新发现。审核结论维持:APPROVE(human merge tier)。 两个修复提交的核验结果
当前状态
结构化八问
收工判定:review 收口,verdict APPROVE(新配置面 + 新 wire family,属 §7.4 human merge tier,agent 不能代合);最终 head CI 绿、无冲突,等你合并。 |
(ai: opencode/qwen3.8-27b) Update — one red lane found and fixed, branch now fully up-to-date with master. After my merge push, the full check-run list on the new head revealed one failure the mirror summary had not surfaced yet: On the head that followed (793a488, after two additional commits landed on the branch from other work): all 56 check runs green or skipped-by-design, zero failures,
While I was watching CI, master advanced by two commits (#5913, stale-epoch overlay fix touching only 结构化八问(中文,覆盖本次 auto-fix 全程)
收工判定:冲突、红 CI、behind 三个阻塞全部解除,分支处于最新 master 基线上且上一 head 全绿;等 ee19f22 的 CI 转绿即可由 owner 合并。 |
[ework] CI fix verified green ✓ |
# Conflicts: # src/server/relay.ts
[bot] 🏷 Conflict resolved and pushed (auto-fix lane, attempt 1/3). What I verified live before touching anything
What I did
Post-push verification (live, mirror cache)
结构化八问(本次运行)
判定:冲突已解除并推送(fast-forward,无 force-push);CI 在新 head 上重跑中(截至写作时刻零失败)。转绿后由 owner 合并(merge 仅限人工)。 |
ranxianglei
left a comment
There was a problem hiding this comment.
End-to-end review at final head 04a7847a2 (branch fully synced to master tip 4446301708; git merge-tree shows zero conflicts).
Independently re-verified this round:
- Feature footprint vs master: exactly 31 files (+2236/−38) — the declared PR scope, nothing more; the two master-sync merges introduced no feature drift.
- All 9 files touched by BOTH master's window and this PR, re-read at the final head: every PR hunk intact and correctly integrated — dsh takeover-gate declaration check remains the first statement ahead of master's
refuseUnattributedpath; classifier priority chain URL-pin > #1909 providers-table >modelEndpointPatterns> built-ins, with the bounded-FIFO once-warn on pin/declaration conflict; client-side claim keeps/bili/+/__bili/control-plane exclusions BEFORE declaration matching; relay rewraps the envelope at the final boundary AND on every compress-loop resend (after v1 wrapping), fake-completion retry disabled for JSONL (itsfinishIS the terminator), commandcode stream-error shapes gated onprepared.commandcode; the plugin JSONL pipe carries the per-field tag/marker filter fix (flush only at terminal frame / EOF / read failure, tails written back as synthetic lines of the original event type). - Docs:
modelEndpointPatternstable row + prose section in docs/configuration{,.zh-CN}.md, wire-contracts under docs/ with index entries, architecture-map rows for the three new modules. - Boundaries: no
kernel/, nopi-subagents/,versionuntouched, no lockfile churn. - CI on
04a7847a2: 30 checks, 0 failed / 0 pending (success/skipped only).
Tests have real teeth: codec round-trips + rejection matrix; a real-HTTP-proxy e2e asserting wire bytes in BOTH directions (upstream sees the flat OpenAI body, client gets the rewrapped envelope); plugin-pipe facet pins (cross-delta tag stripped as one unit, held prefix survives to the terminal frame, forged marker completed across deltas fully stripped); declaration-matching truth table including segment-boundary negatives and control-plane exclusion. These would catch regressions of exactly this bug class.
Behavior changes (the six old→new items disclosed in the PR body) all match the implementation; the declaration-driven compression of custom paths is additive — undeclared URLs take byte-identical behavior to before.
Verdict: APPROVE. New config surface (modelEndpointPatterns) + new wire family (commandcode) place this PR in the human merge tier per §7.4 — merging stays with the owner.
中文摘要:最终 head 已完全同步 master 尖端且零冲突;本 PR 特征集相对 master 恰为 31 个文件,两次 master 同步合并未引入任何功能漂移;master 窗口与本 PR 双触的 9 个文件逐一复核,PR 增量全部完整且集成正确(dsh 声明放行仍为 gate 首语句、分类器优先级链与有界一次性告警、客户端 claim 的 control-plane 排除前置、relay 终边界+压缩循环 resend 双重包、JSONL 关闭假完成重试、plugin pipe 逐字段过滤器修复在位);无 kernel/pi-subagents 改动、版本未动;CI 全绿(30 项检查 0 失败)。测试有牙:编解码往返+拒绝矩阵、真实代理双向线字节断言、plugin pipe 三个缺陷面钉死、声明匹配真值表。PR 描述披露的六项行为变更与实现一致。判定 APPROVE(新配置面+新 wire family,属 §7.4 人工合并档,合并操作归 owner)。
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b) head 本轮做了什么
结构化八问
收工判定:review 收口,verdict APPROVE(新配置面 + 新 wire family,属 §7.4 human merge tier,agent 不能代合);最终 head CI 绿、无冲突、无遗留发现——等你合并。 |
# Conflicts: # src/server/handle.ts
[bot] 🏷 Conflict resolved and pushed again (auto-fix lane, attempt 1/3 of this cycle). Why the trigger was real this time What I did
Post-push verification (live)
结构化八问(本次运行)
判定:冲突已解除并推送(fast-forward,无 force-push);GitHub 现报 |
[bot] 🏷 Confirmation (this cycle's report is already on the thread as the previous comment, 01:30Z):
Nothing further to add this run; will act again only if CI turns red or master introduces another conflict. |
[ework] CI fix verified green ✓ |
1 similar comment
[ework] CI fix verified green ✓ |
|
Equivalence check, recorded so nobody has to redo it:
Proof that the two heads carry the same content despite diverging histories: So the three files #6032 picked up past this branch's tip ( Nothing is outstanding on the code side here. The one remaining step is a single human merge, on either PR. |
[bot] 🏷 Equivalence record independently verified — and the branch is still clean as of this run. What I did (verification only, nothing pushed)
Where things stand: both PRs carry byte-identical content, so either can be merged with nothing lost. The remaining step — a single human merge on either #1444 or #6032, plus the call on closing the now-redundant twin — belongs to @ranxianglei (merging is human-only under system rules, and agents don't close PRs/issues). |
[PR] Rebase #1444 onto master: declarable model endpoints + commandcode wire family
# Conflicts: # src/server/relay.ts
[bot] 🏷 Conflict resolved and pushed (auto-fix lane, attempt 1/3 of this cycle). Environment note first: the workspace had been re-provisioned since the last run (fresh empty git repo, no Why the trigger was real What I did
Post-push verification (live)
结构化八问(本次运行)
判定:冲突已解除并推送(fast-forward,无 force-push);GitHub 现报 |
|
#1444 is now an empty PR — the close decision, with evidence Filed here rather than in #5128 because the decision belongs to this PR. Verified live just now, no re-derivation needed on your side: That is not a rendering glitch. The head tree and the base tree are identical:
Suggested disposition: close it (optionally with One caveat on permissions: this head lives in the base repo ( |
[bot] (ai: vllm-qwen/qwen3.8-27b) @suyeku1 的空 PR 判定已核实属实;唯一红 lane 是 master 级测试问题,不是本 PR 的回归。 本次实跑验证(非转述)
处置(需要你一步操作)
结构化八问
收工判定:空 PR 已核实,建议 owner 关闭 #1444;红 lane 定性为 master 级测试问题,已在 #4599 留痕,本分支无需进一步动作。 |
[ework] auto-fix stalled: test (windows-latest, 22, 5) — stopping for human review |
|
test-connection |
|
Closing: the branch is fully in sync with master — the three-dot diff |
Part of #1295
What
Two commits implementing the owner-approved plan:
① f4862e8 — one config source for both claim gates
modelEndpointPatterns:[{ match: <absolute URL prefix>, wire: "openai"|"anthropic"|"responses"|"google"|"commandcode" }], longest-prefix wins.src/server.tsclassifier): a declared pattern now decides protocol classification for its URL — including known families on non-standard paths (previously suffix-table only).src/agent/native-intercept.ts):isModelApiUrlconsults the same patterns (module-level registry, loaded best-effort from the global config file by every native entry: pi/omp/opencode V1+V2/dsh at apply time), so the fetch patch claims declared endpoints too. The two hardcoded tables can no longer drift for declared paths.② 1cd7e6a — first new wire family:
commandcode@mars-sea/dsh-commandcode-providerGo plan —POST https://api.commandcode.ai/alpha/generate, nested CLI envelope request ({config, threadId, params:{model, stream, messages, tools, system, …}}, CC block content), bare JSONL event-stream response ({"type":"text-delta",…},{"type":"finish","finishReason","totalUsage"}) — not SSE.src/commandcode-wire.ts: strict envelope unwrap (→ flat OpenAI-family body for the existing pipeline) and rewrap (final wire boundary stays the envelope; pipeline modifications ride insideparams). Unsupported shapes → verbatim relay, never silent loss. Fidelity rules:params.system↔ leading system message round-trip, tool results keeptoolName(+error-texttype viaerrorResultIds), unknown top-level keys preserved.src/loop/adapter-commandcode.ts: OpenAI-family adapter spread with a JSONL codec (no SSE framing, no[DONE]); usage fromfinish.totalUsage; tag-echo filtering applies to prose deltas only; proxy tool calls settled into structured events.pipePluginJsonlWithStrip(usage accounting + degenerate-turn warning, no synthetic tails).{"type":"error","error":…,"message":…}matching what the client throws on.WIRE-CONTRACTS.md(+zh): per-endpoint upstream-constraint ledger WC-1…WC-6 (each constraint discovered → permanent entry, cited inline in code).modelEndpointPatternssection added to CONFIGURATION.md + zh mirror; cross-references in Providers sections.Behavior changes (old → new)
modelEndpointPatternsas an additional source (built-in suffix tables unchanged; declarations are additive and checked first).modelEndpointPatternsas the fix path (log text only).Pre-flight
npm run typecheckcleannpm test: identical failure set to clean master baseline (single pre-existing#393: --upstream mode … claude-opus-5(-thinking) to 1Mfailure, present on master before this branch)npm run buildOKtests/commandcode-wire.test.ts(codec round-trips/fidelity),tests/adapter-commandcode.test.ts(JSONL parse/emit/usage/errors),tests/commandcode-endpoint.test.ts(server-level: declared endpoint unwrapped upstream & rewrapped back down, non-conversation relay, WC-6 demotion, declaration-driven classification)No version bump (release flow owns that). No acp-kernel change.
Fixes #1295
(孤儿认领:标题本已指向 #1295,补上关闭关键字 —— 第三批清理)