Repository navigation
[PR] refactor: converge buildXxxEnv family into data-driven client-env presets (#1440) - #1450
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-1450Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1450.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Reviewing this PR now. Initial state: branch |
[bot] 🏷 Review complete — approved, ready for human merge. Scope & direction (①): First item of the #1440 audit P3. The root cause is six hand-maintained copies of one cert-MITM env contract in Regression review (②) — existing behaviors on the touched paths, itemized:
Code (③): type-safe dispatch ( Tests (④): the six per-client goldens ( Diff (⑤): single file, +45/−33, one commit, base = current master (0 behind), every line serves the dedup. Clean. CI: all 12 check runs green on Verdict: behavior-neutral refactor, pinned by CI + goldens + inspection. Per §7.4 a 中文摘要:审核了 #1440 审计 P3 首项(src/launcher.ts 六个 buildXxxEnv 收敛为数据表 + 单一内部构建器),逐客户核对新旧 env 对象键值与插入顺序完全一致、公开 API 与调用点零变化、来源注释保留;本地 typecheck 与定向测试通过,CI 12 项全绿,确认无行为变更,可以合并。 |
|
(ai: zhipuai-lb/glm-5.3) 孤儿票清理:标题指向的 issue 已关闭,修复已由其他路径落地。关单;误判请 reopen。 |
What
First item of the #1440 audit's P3 (protocol×client matrix copy-paste): the six
buildXxxEnvfunctions insrc/launcher.tscarried four byte-identical bodies (codex/trae/copilot/amp), one NO_PROXY variant (jcode) and one dual-CA variant (aider).Now: one data table (
CLIENT_ENV_PRESETS) + one builder (buildClientEnv, internal) encoding the shared cert-MITM env contract — proxy origin + CA + marker — with per-client deltas as flags (noProxy,requestsCaBundle, plus aider's existingrouteHttp). The six public names remain as one-line wrappers, so all call sites and tests are untouched.Adding a future client = one table row + one wrapper line (previously: copy-paste a whole function body).
Behavior change disclosure
None. The generated env objects are key-for-key identical for every client:
{HTTPS_PROXY, SSL_CERT_FILE, BILLION_CONTEXT_PROXY}over baseEnvNO_PROXY/no_proxyloopback pairREQUESTS_CA_BUNDLE, conditionalHTTP_PROXY(routeHttp), loopback pairVerification
npm run typecheck— cleannpm test— 2839 pass / 0 fail / 12 skip (= master baseline); the six pre-existing per-client env golden tests intests/launcher.test.ts(which assert exact key/value shapes incl. 新增 bili aider 启动器 #1048/新增 bili copilot / bili amp / bili goose 启动器(第三梯队) #1049 semantics) pass unchanged against the new implementationnpm run build— successRefs #1440