Repository navigation
fix(#2260): v0.1.186 review follow-ups — dsh spawn leak, inert resign keys named at config load, codex arg/TOML fixes, web pristine root, misc - #2263
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2347-pr.2263.c77c332This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2263.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review 完成(13 个原始 commit + 2 个 review 修复 commit,18 文件)。每项都对着实际 diff 逐条核对,本地跑了定向测试(tsc clean;launcher/codex-profile-effective/web-sessions/plugin-update/issue2260/issue2187×2/pi-subagents-wiring 共 345 pass / 0 fail)。review 中发现两个小问题,已按「小问题直接修」在分支上直接修掉(见第 4 问)。 结构化七问
其余备注
结论:方向与实现均成立,无回归、无缓存影响、无新配置面。CI 转绿后可合(合并操作请你执行)。 |
…abandoning it A of #2260 (review follow-up to #2187): ensureProxyRunning's timeout path threw while the detached child was still alive; only the starting marker was cleared. In the dsh plugin lane the spawner is a long-lived desktop host, so BILI_PARENT_PID self-watch never fires and every failed bring-up leaked one node process; plan-time retries re-arm every 10s (dsh-native maybeRetry), turning one persistently slow host into ~1 zombie per ~70s, each also stranding the lane sticky-port ladder. Fix at the producer: killAbandonedChild() SIGKILLs the group + child on every platform before the timeout throw (stopProxy is deliberately not reused — its win32 early-return assumes the spawner exits ≤2s later). The victim never became healthy, so it served no traffic and holds no sessions; stale instance records stay inert via the dead-pid checks. Regression test pins exactly one SIGKILL on the never-healthy path.
D of #2260 (#2197 regression): cli.ts only eats a LEADING -- right after the client name, so in e.g. `bili codex exec -- "-p"` a non-leading -- reaches buildCodexArgs inside extra. The rewrites were appended after it — past a -- everything is positional to codex's parser, so the -c pairs became prompt text and the traffic silently bypassed the proxy. Insert at the first -- instead; all user flag tokens still precede the rewrites, keeping #2197 last-wins intact. Two regression tests pin the placement and the cross--- last-wins invariant.
…ulti-line values E of #2260: the key-side regex only accepted \w runs inside quotes, so valid quoted keys with spaces or non-ASCII ("my key" = 1, "ключ" = 2) false-positived as structurally broken and bili refused the whole launch (exit 2) where codex 0.147 parses the profile fine. Replace with TOML-correct key parts (bare / basic string with escapes / literal string, dotted in any mix) evaluated on the scanner-extracted key side. Same mechanism, second facet found while fixing: bracket-opened values spanning lines (arrays, inline tables) also false-positived, violating the checker's own contract ('valid TOML must pass silently'). Add a quote/comment-aware line scanner tracking array depth so continuation bodies are treated as value context, and report an unclosed array/table at EOF.
…mcode command resolution
…nce through the real resolver
…s CI) The two default-platform assertions in the new test resolved through the real host: on a Windows runner process.platform is win32, so resolveClientCommand took the %LOCALAPPDATA% layout and os.homedir() read USERPROFILE (not the HOME the test set), failing both antigravity and (once reached) mcode expectations. Windows CI runs of e4827d6 show exactly this single failure (4427 tests, 1 fail) on both node versions. Pin both layouts with explicit platform args ("win32"/"linux") and seal USERPROFILE like the sibling tests, so the test holds on every host.
1a9f792 to
8e6e31e
Compare
[bot] 🏷 冲突已解决,rebase 完成并推送。 发生了什么:master 前进到 七问(针对本次冲突处理):
CI 正在对新 head |
[bot] 🏷 CI 全绿,冲突处理闭环。
最终判定:可合并(合并由人执行)。完整 review 结论见上一条(逐提交审查 + 回归审计 + 七问);本次 rebase 本身零语义变化,保留 diff 即 A/D/E/F 全部工作。遗留事项仅 B-2(shape-detection 误报面)等 owner 裁决,不阻塞本 PR。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.77-master.dcf6ec4 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Scope
Working the consolidated tracker #2260 (merged review follow-ups #2252–#2257 of the v0.1.186 review of #2249). One commit per item, each labeled.
Closes #2260 — with one caveat: B-2 (shape-detection false-positive surface) is awaiting owner ruling on whether the widened detection surface is intentional; if yes it becomes a small docs-only follow-up, if no it needs a narrowing direction. Reopen or re-trigger for that remainder if needed.
Items
../kernel-review(acp-kernel 0.0.42) entry leaked from a sibling-checkout installensureProxyRunningnow hard-kills the spawned child (SIGKILL group + process, win32 skips the group kill) BEFORE throwing, with a visible log line. Previously the child stayed alive: in the dsh plugin lane the parent never exits so theBILI_PARENT_PIDself-watch never fires, and plan-time retries respawned ~every 70s → hung node children accumulate forever, each also laddering the lane sticky port +1src/server.ts:902: middle segment of the [resign] startup banner used double quotes, printing${displayHost}:${actualPort}literally — now interpolates like its neighborsbuildCodexArgsinserts the appended-c key=valuetransport rewrites BEFORE the first user--separator instead of after it. With a non-leading--(e.g.bili codex exec -- "-p") the rewrites used to become positionals → traffic silently bypassed the proxy + dirty prompt. No--in user args: byte-identical argv as beforecodexTomlProblemnow parses the key side with a real TOML key pattern (bare / basic string w/ escapes / literal string, dotted mix) and tracks bracket depth across lines: quoted keys with spaces/non-ASCII ("my key" = 1,"ключ" = 2) and multi-line arrays/inline tables no longer trigger the fatalprocess.exit(2)on VALID profiles; genuinely unclosed structures are now detected (previously passed silently)resign["<non-builtin-scheme>"].passthrough=truewhose guard cascade resolves enabled gets ONE[acp-config]warn per distinct dead-key set (signature-based dedup, #1815 style), stating the key is inert since the #2090 compress-or-refuse contract and pointing at the working alternatives (resign["<scheme>"].enabled=false,BILI_RESIGN=0). Log-only; no behavior change. Scans both the rootresignmap and everyproviders[*].resignmaprelease-notes/package.json: v0.1.186 entry, tier critical (user-actionable breaking change → CRITICAL UPDATE READY surfaces): unsigned pass-through is builtin-scheme-only since #2090, other signature schemes refused until bili ships its re-signer, inert keys named at config load; + the #2187 spawn-leak fix. ≤400 chars, bilingual, newest-firstopencodeCacheCopyRootspec-slot selection was lexicographic (@0.1.9beat@0.1.186); now numeric-segment compare when both sides parse as dotted versions, string fallback otherwise (solatestkeeps its prior relative position). Display/inspect-lane onlyca/, created byensureRootCA()at every proxy start) — or none at all — is pristine, so a fresh install's first/__bili/sessionsload returns empty data instead of HTTP 500. Foreign content under the data root stays loud (#1937 intent preserved)withEnvnow sealsBILI_PROVIDER_REWRITES/BILI_MITM_HOSTS/NODE_EXTRA_CA_CERTS— ambient leakage flippedplanNativeDshto mode "off" and made the suite's timeouts test nothingresolveClientCommandantigravity + mcode branches usedprocess.platformdirectly despite the injectableplatformparam (codex branch already used it) — win32 layouts were unreachable from tests. Both now honor the param; real-host behavior identical (default = process.platform)PI_ACP_DELEGATE_* > pi.subagents > acp.json > defaultprecedence through the REAL chain (bili file loader → adapter mapper → bundled billion-context-pi-subagents@0.1.1resolveDelegate). Verification result: the docs are CORRECT — env is consulted first per-field inside the bundled resolver even whenpi.subagentsis set, so no doc change was needed; the reviewer's "env may be silently ignored" suspicion does not hold for @0.1.1, and this test makes sure it stays that wayRecorded-for-reference NITs deliberately NOT touched (separate mechanism families): fold-reconcile METADATA_DRIFT_ESCALATED ordering, rediscoverAfterChildExit spin on foreign squatters, pi session_start tool re-registration.
Behavior changes (old → new)
--: rewrites moved from AFTER--(positionals, proxy bypass) to BEFORE--(effective). Without--: unchanged.${displayHost}:${actualPort}.Config surface
No new config fields, env vars, or CLI flags. B-1 warns about EXISTING keys (
resign[<scheme>].passthrough,.enabled,BILI_RESIGN); thePI_ACP_DELEGATE_*test pins existing documented behavior. Nothing to migrate.Testing
Targeted suites run green locally (full regression is CI's job): launcher (+win-cmd-argv) 305 pass/5 platform-skips incl. new buildCodexArgs placement + platform-param cases; issue2187-launcher-slow-start 5/5 (new kill-on-timeout assertion); codex-profile-effective 16/16 (quoted-key + multi-line corpus, unclosed-structure negatives); issue2260-inert-resign-passthrough + issue1815 8/8; plugin-update 8/8 (version-ordered slots); web-sessions 17/17 (ca/-only pristine + foreign-content-stays-loud); issue2187-dsh-spawn-retry 2/2; pi-subagents-wiring 16/16 (new precedence pin);
npm run typecheckclean.Pre-release note for #2249
C-1, C-2, B-1 (+its test) and the release-notes entry are the "before release" items from #2260: they should reach the
2026-10-06_release-v0.1.186branch before #2249 merges (cherry-pick of c927495, 9cc1d79, 15fb12c, 6502206, optionally 1482e1b) — flagged here rather than pushed to the release branch unilaterally.