Repository navigation
[PR] fix: keep /bili/ base-URL legs direct when clients honour proxy envs (Claude Code 2.1.301 self-tunnel 403) - #3448
ranxianglei wants to merge 2 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4584-pr.3448.7723e42This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3448.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。本 PR 是 #3446 的修复 PR;与 #3245/#3251 同属「自指代理 403」症状家族但生产者不同(客户端 GUI 代理设置 vs bili launcher 自身 env 组合),已在 issue 侧正确拆分并互链。 审核方式: 独立重读了 diff、全部调用点与测试,本地定向跑了改动面测试(typecheck + launcher 四个套件),未照抄 #3446 线程结论。 结构化八问
行为变更披露(PR 正文已有 old→new 表,我核对属实):claude lane 子进程 env 从无 bili 自有 NO_PROXY/no_proxy(裸继承)→ 两个 key 均设为「既有值 ∪ localhost,127.0.0.1,::1」;codebuddy lane 从全剥光无 NO_PROXY → 追加三件套。原因:保证子进程能直连 bili 自己的 listener,loopback-only 排除不影响任何真实上游/公司代理的路由。 测试有效性:7 个新测试都是精确值断言(合并三件套、双大小写变体并集+去重保序、幂等、raw-https 胜出时不合并、codex 不受碰、codebuddy 对等),bug 回归能被抓住;#890 更新后的断言同时钉住「launcher 三件套存在」与「继承 .corp 条目仍被剥离」。不是假测试。 我顺手修了一个小问题(独立标注 commit):PR 在更新 #890 测试时把断言失败信息里的参数写成了 验证证据:本地(分支上,先建 kernel/pi-subagents dist) 判定:可合并——方向对(根因层修复)、回归清点干净、测试有牙、diff 整洁、行为变更已披露。等 owner 人工合并 + 新 head CI 全绿即可。 |
(ai: vllm-qwen/qwen3.8-27b) CI 跟进:新 head 结论维持:可合并,等 owner 人工合并即可。 |
a505801 to
5a17917
Compare
|
This branch's work continues in #3856: Two ways to take it, your call:
Either way your own diff needs no re-review: your launcher, test and |
5a17917 to
7dbdd10
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不适用——本条是系统冲突转发(merge state dirty)而非新缺陷报告;工作对象就是本 PR 自身。 冲突已处理完毕:PR 分支已 rebase 到最新 master( 八问:
补充:分支在唤醒前已被 squash/rebase 过一次( 判定:可合并——意图双保、diff 收敛回 6 文件、本地定向验证通过;待新 head CI 转绿后由 owner 人工合并。 |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不适用——这是外部贡献者(@aolshevskiy,未验证身份)在 #3856 上的整合请求,不是新缺陷报告。我已逐条只读核实其技术声明,但两条处置路径都不在我可自主执行的范围内,需要 owner 拍板。 核实结果(全部只读验证过):
为什么两条路径我都不自行执行:
八问(决策请求,选项见下表):
判定:推荐 C——两笔变更本就是两层工作(已评审的 NO_PROXY 止血 + 未评审的根因清理),分列合并各自留痕最干净;等 owner 拍板,我的分支 |
|
Taking Option C. Your correction is right and mine was wrong: our base was Sequence as you describe it: #3448 merges on its own, #3856 goes through its own review, and once #3448 lands I rebase #3856 onto the post-merge master and collapse it to the single In the meantime I rebuilt #3856 on current master Separately, the On §7.4, so the wire delta is on the record for whoever signs it off: the addition is the read-only |
…li/ base URL is set (#3446)
…d on master since a4f2730 (#3811) Drive-by fix for the pre-existing master CI red (unused-exports gate), folded here per the repo's few-line-fix dispatch discipline instead of a second PR. The gate's own prescription: drop the leading export. Verified zero references outside src/log-mask.ts on current master.
7dbdd10 to
0c8a166
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不适用——本线程整合流程的延续(选项 C 确认 + master CI 红处置),非新缺陷报告。 序列确认:按选项 C 执行——#3448 独立合并;#3856 走自己的评审轮,#3448 落地后 rebase 到合并后 master 并收敛为单个 auxProxy 变更。你们的撤回与更正无异议。 核实结果(只读验证):
处置(有范围披露):那个一行修复不需要单独开 PR——按仓库几行级小修调度纪律(CI 失败类小修首选在当前 PR 顺手修掉,避免第二个 PR 修同一行),我已把它作为独立标注 commit 并入 #3448,并顺带把分支 rebase 到最新 master 八问:
判定:序列不变——等 #3448 在新 head |
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #3446 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
Closes #3446
What
The
bili claude(andbili codebuddy) launcher setsHTTPS_PROXY=http://127.0.0.1:<port>alongside a base-URL override pointing back at its own listener (ANTHROPIC_BASE_URL=http://127.0.0.1:<port>/bili/https://api.anthropic.com). That design assumed Claude Code ignoresHTTPS_PROXY(true for older builds' undici fetch). Claude Code >= 2.1.301 now honours proxy env vars, so the/bili/leg goes out through the same listener: pre-#3251 that was a hard 403tunnel_destination_denied: self; with #3251 (merged, not yet released) it becomes a wasted forward-proxy hop through itself.Two layers
curl -x http://127.0.0.1:<port> "http://127.0.0.1:<port>/bili/http://127.0.0.1:<mock>/echo"returns 200 with zero[tunnel] deniedlines. The hard failure disappears once fix: serve self-addressed absolute-form requests locally instead of self-denying them (ZCode, #3245) #3251 ships.localhost,127.0.0.1,::1) into the child'sNO_PROXY/no_proxy, preserving whatever the user already set in either case variant. The/bili/leg stays direct regardless of which client build behaviour applies — no extra hop, no dependence on fix: serve self-addressed absolute-form requests locally instead of self-denying them (ZCode, #3245) #3251 shipping first.Behavior change (old -> new)
claude(base URL wraps to/bili/)NO_PROXY/no_proxy(rawprocess.envinherited as-is)localhost,127.0.0.1,::1; user entries never droppedcodebuddy(base URL wraps to/bili/)NO_PROXY/no_proxy/bili/form)Why: keep bili's own listener directly reachable from the child. A loopback-only exclusion cannot alter routing to real upstreams or corporate proxies.
Config surface: none — no new config key, env var, or CLI flag. (
NO_PROXYhere is child-process routing hygiene, documented in CONFIGURATION.md en/zh.)Kernel: untouched. Wire / compression modes: untouched (launcher-only change; both-mode reasoning trivially holds since no request path changes).
Tests
tests/launcher.test.ts: wrapped base URL => merged triple; union of both case variants preserves user entries + dedupes; already-complete value unchanged; raw-https upstream wins => no merge; codex (no base-URL lane) untouched even with proxy set; codebuddy parity.NO_PROXY/no_proxywhile inherited.corpentries stay stripped.tests/launcher.test.ts309/309,tests/launcher-gemini-family.test.ts28/28,tests/fix-1292-windows-claude-settings.test.ts+tests/launcher-plugin-mode.test.ts13 pass / 1 skip,npm run typecheckclean. Full-suite verdict = CI.Docs
Stale "undici fetch ignores HTTPS_PROXY" claims updated in CONFIGURATION.md/zh (manual section, env table row, launcher paragraph), README.md/zh (#2290 field-test note), and the in-code comment in
discoverRoutes. Historical CHANGELOG/devlog entries left as-is.