Repository navigation
[PR] fix(zcode): point GUI cert-MITM CA path at combined-ca.pem, not root-ca.pem - #5736
ranxianglei wants to merge 3 commits into
Conversation
…ca.pem (#5725) ZCode's "Proxy CA certificate path" field REPLACES the client's whole trust store (and propagates into child env vars with the same replace semantics), so handing it the single-cert root-ca.pem breaks every non-MITM fetch — including ZCode's own plugin-marketplace refresh — with "unable to get local issuer certificate", reintroducing the #152 failure class. combined-ca.pem is the superset bundle (MITM root + public/OS roots, #1807) that validates both the MITM leg and real public chains under replace semantics, matching how the codex/dsh/hermes launcher lanes already point SSL_CERT_FILE. - docs (CONFIGURATION.md en + zh): cert-MITM one-time setup step 2 + Windows absolute-path note now recommend combined-ca.pem, with the why. - web UI: ZCode card displayed path + copy button now emit combinedCaPath(). - tests/web-routing.test.ts: assertions updated to the combined bundle. - consistency: de-stale rootCaPath() doc comment; zcode/native.ts guidance strings say "combined CA path".
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8980-pr.5736.1f486d3This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5736.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。本 PR(GitHub #5736)是 #5725 的唯一修复 PR;open [PR] 列表里没有第二个针对 zcode cert-MITM CA 路径的并行 PR。 标签: PR 审核结论 · GitHub #5736head 八问
一个非阻塞观察(我判断现状自洽,供你定夺):CONFIGURATION.md:2310 / CONFIGURATION.zh-CN.md:2278 step-1 的 验证:本地 clone 无 node_modules,跑定向测试需 判定:代码正确、完整、范围收敛,行为变更已如实披露(旧 |
(ai: vllm-qwen/qwen3.8-27b) CI 修复完成(继承红,已收敛 ci-fixes) —— 新 head 八问:
判定:本轮收工——等待新 head |
[bot] 🏷 补一条状态更新(完整八问审核见上一条,不重复): CI 现状已变(我发审核结论时镜像缓存还是空的):分支 HEAD 已由 CI 工程师推进到
剩余唯一卡点: 我没有动这个分支:CI 工程师已持有并正在推进(楼内接管记录),且现在没有红要修——我再上去 rebase 会跟它的并发工作打架(正是要避免的「两个 agent 抢同一分支」)。代码判定维持不变:正确、完整、行为变更已如实披露。合并权在你。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Posted as a comment-review because the reviewing token is the PR author's account and GitHub forbids self-approval — the verdict below stands as APPROVE; a maintainer can record the formal approval.
APPROVE — clean, correctly scoped, CI green on head 5ae4927c2 (mirror cache: failed=0, pending=0).
Independence note: verdict re-derived from the diff + source, not from the issue text. Verified against src/ca.ts (generation), src/web/page.ts (render), and a full grep of every remaining root-ca.pem reference in src/ + docs.
Correctness. combinedCaPath() (~/.local/share/billion-context/ca/combined-ca.pem) is the MITM-root + Node-public-roots + OS-store superset (#152/#1807). The ZCode GUI "Proxy CA certificate path" field replaces the client trust store and propagates into replace-semantics child env (SSL_CERT_FILE/CURL_CA_BUNDLE/REQUESTS_CA_BUNDLE), so it needs exactly that superset — the single-cert root-ca.pem cannot validate blind-tunnelled real public chains, breaking every non-MITM fetch (incl. ZCode's own plugin-marketplace refresh). ensureRootCA() writes both root-ca.pem and combined-ca.pem in one startup call, so the UI's caReady = existsSync(caPath) readiness semantics do not regress (a fresh install has the bundle present before the UI is reachable; the #5103 write-refusal path either reuses a valid bundle or fails fast before the proxy serves). page.ts now sources the displayed path, the copy button, and the readiness badge from a single caPath = combinedCaPath() — no dangling rootCaPath import/ref remains.
No missed spots. Every other root-ca.pem reference is either append-semantics (launcher NODE_EXTRA_CA_CERTS, hermes legacy HERMES_CA_BUNDLE, the two mitm.ts "install/trust the root CA in your store" logs) or generic "the MITM root" prose (setup step-1 existence check, launcher-reference bullet) — none feed a replace-semantics GUI field, so leaving them is correct.
Diff hygiene. The zcode commit a442dd3e8 touches exactly its 6 in-scope files (2 docs, src/ca.ts, src/web/page.ts, src/zcode/native.ts, tests/web-routing.test.ts). The six tests/issue2419/2446/2447/2481/2817/5403 changes are not bundled scope creep: they arrive through the origin/ci-fixes sentinel merge (5ae4927c2) — the prescribed absorption of the inherited master red (#5656 sidecar residual broke five dsh regression pins + the fastpath stamp). Net master..head = 12 files, nothing unadvertised.
Tests. tests/web-routing.test.ts asserts the rendered ZCode card carries the machine's real combined-ca.pem path, the copy button emits it, and it is not a hardcoded ~/… string — reverting page.ts to rootCaPath() fails all three, so it is a genuine regression guard, not a tautology.
结构化八问
- 是什么问题:ZCode GUI 的「Proxy CA certificate path」字段(及文档 step2 / Windows 注、网页卡片显示+复制按钮)让用户填单证书
root-ca.pem;该字段是 replace 语义(替换客户端整个信任库,并以同样语义下发到子进程 env),导致所有非 MITM 抓取(含 ZCode 自己的插件市场刷新)报unable to get local issuer certificate,复现 #152 失败类。 - 什么原因导致的:把 replace 语义的消费者指向了只含 MITM 根的单证书文件;非白名单主机走盲隧道、呈现真实公共证书链,单证书信任库无法校验这些链。
- 影响范围与严重程度:仅 ZCode cert-MITM GUI 这一条姿势面;按文档填了
root-ca.pem的用户,其模型流量(MITM 腿)仍正常压缩,但该主机的非模型抓取(插件市场刷新等)全挂——核心能力可用、特定功能异常且有绕行(手动指向combined-ca.pem),属功能性缺陷而非核心可用性丢失。未触及其它车道/代理模式。 - 怎么修复的:把 GUI 字段、文档(step2 + Windows 注)、网页卡片显示+复制按钮统一指向既有超集包
combined-ca.pem(MITM 根 + Node 公共根 + OS 信任库,#1807),与 codex/dsh/hermes launcher 车道一致;root-ca.pem保留为 append 语义(NODE_EXTRA_CA_CERTS)的目标。 - 是否有回归问题:无。逐项过既有行为——网页卡片路径/复制按钮/就绪态(均改指 combined,有意且已披露)、en+zh 文档 step2+Windows 注(有意)、
ca.tsrootCaPath()doc comment(去陈旧,纯注释无行为)、zcode/native.ts两条日志措辞(用户可见文案,无行为变更)、web-routing.test.ts(断言对齐)。高危模式逐项:无语义漂移(改动即目标语义,已披露旧值→新值)、无 fail-fast 变吞错、无默认值/阈值/时序漂移、缓存/重试策略不受影响;existsSync就绪语义不回归(两文件同一ensureRootCA()内生成)。 - 是否破坏缓存:不涉及——不触碰压缩/折叠/会话/前缀缓存任何逻辑。
- 是否改了设计方向:不涉及架构/边界/数据流转向;只是把一个既有字段指到正确的既有产物。
- 是否引入新的配置:无(无新 env / config key / CLI flag;PR 正文已声明 Config surface: None)。
判定:可合。 核心修复正确、范围干净、CI 在 head 上绿;六处 dsh 测试项为 ci-fixes 哨兵并入(继承 master 红 #5656 的规定处置流程),非夹带无关改动。
(ai: vllm-qwen/qwen3.8-27b) Review of upstream #5736 done: APPROVE — posted as a comment-review (GitHub blocks formal self-approval since the token is the author’s account). Core CA-path fix is correct and cleanly scoped; the six dsh test-pin changes are the sanctioned \ sentinel absorption of the inherited master red (#5656 sidecar residual), not bundled scope creep; CI green on head 5ae4927 (failed=0). No small findings requiring an on-the-spot fix. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) PR review 完成,判定 APPROVE / 可合。
Review 已发(comment-review 形式——token 账号即 PR 作者,GitHub 禁止正式 self-approve,正文判定为 APPROVE,maintainer 可补点正式 approve): 结论:可合。 合并权在 maintainer(agent 不合并 PR)。 |
…ve conflict (re-apply combined-ca.pem lines to docs/configuration*, keep root redirect stubs)
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved — What the conflict actually was: master moved
One transparency note: the mirror's upstream-checks cache for this PR is stale (last fetched 2026-11-05, still showing the old head), so I could not read the post-push check states from it — the live GitHub GET above is the verification for mergeability, and the CI re-run on 八问:
判定:本轮收工——冲突已解(live 验证 mergeable=true)、等 |
[ework] CI fix verified green ✓ |
1 similar comment
[ework] CI fix verified green ✓ |
Closes #5725
What & why
ZCode's desktop Proxy CA certificate path field replaces the client's entire trust store, and propagates into child env vars with the same replace semantics (
SSL_CERT_FILE/CURL_CA_BUNDLE/REQUESTS_CA_BUNDLE). The docs and the web-UI copy button were handing out the single-certroot-ca.pemfor that field, so every non-MITM fetch — including ZCode's own plugin-marketplace refresh — failed withunable to get local issuer certificate, reintroducing the #152 failure class.combined-ca.pemis the superset bundle bili already maintains (MITM root + Node public roots + OS trust store, OS-store merge since #1807) and is exactly what the codex/dsh/hermes launcher lanes pointSSL_CERT_FILEat. It validates both the MITM leg and real public chains under replace semantics, so it is correct whether the consuming host appends or replaces.Changes
CONFIGURATION.mden +CONFIGURATION.zh-CN.md): cert-MITM one-time setup step 2 and the Windows absolute-path note (证书路径兼容 #342) now recommendcombined-ca.pem, with a one-line why.root-ca.pemstays documented as the append-semantics (NODE_EXTRA_CA_CERTS) target.src/web/page.ts): the ZCode card's displayed path and copy button now emitcombinedCaPath()instead ofrootCaPath().tests/web-routing.test.ts): assertions updated to the combined bundle.rootCaPath()doc comment (it claimed ZCode points at the single cert); twozcode/native.tsguidance strings now say "combined CA path".Behavior change (old → new)
The CA path surfaced to ZCode users changes from
…/ca/root-ca.pem→…/ca/combined-ca.pem. Intended — this is the fix. No change to append-semantics launchers; no config-schema / persistence / wire change.Config surface
None — no new env var, config key, or CLI flag.
Verification
node --import tsx --test tests/web-routing.test.ts→ 8/8 pass (incl. the updated ZCode-card assertion).tsc --noEmitclean. Full-suite verdict deferred to CI on this head per repo test discipline.