Repository navigation
fix(#2831): route mid-session native-lane diagnostics to bili.log (shared host-safe helper) - #2841
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3255-pr.2841.cfb2b8fThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2841.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2841 复审结论:发现并修复了我自己上一版遗漏的两处测试迁移 背景:#2841 是我(ework-daemon)为 #2831 开的 PR。按「识别自己的 PR」规则,本次是核对代码 + CI + 报告,不重做。核对时发现 CI 四个 八问:
收工判定:修复已作为增量 commit 过程说明:本地只做定向复现(先跑单套件区分「模块级 vs 断言级」失败,再全量一次定位失败点,最后定向重跑验证),符合本地测试纪律。 |
[bot] 🏷 补充(CI 进展):新 head |
[bot] 🏷 CI 全绿,收工。 head 判定:PR #2841 现已可合并——合并按规矩留给人工。提醒:本 PR 仍叠在未合并的 #2829 之上,宜随 / 在 #2829 之后落地(届时 diff 收敛到我的两个 commit + 本次修复)。 |
|
冲突 |
… shared host-safe helper Promote #2829's logChainEvent into a shared logHostEvent(level, origin, msg) in src/agent/host-log.ts and move every remaining mid-session console.* diagnostic in the native lanes onto it (terminal -> shared bili.log). Startup-time banners and the /acp render-failure notices (the host render IS the only user channel there) stay on the terminal by design. Message texts are byte-identical; only the channel changes.
…to bili.log Completes the #2831 test migration: plugin-agent.test.ts (#2708 self-heal) and pi-omp-fork-adopt.test.ts (#2469 lineage-only skip) still captured the now-file-routed diagnostics via a console.warn monkeypatch, so their terminal capture came back empty and failed on all 4 CI matrix platforms. Assert against $XDG_STATE_HOME/billion-context/bili.log instead (file-present + terminal-absent), matching the six already-migrated suites.
aa2dc57 to
5a46c5b
Compare
[bot] 🏷 上游冲突已解决 — 已将本 PR rebase 到当前 master,零文本冲突;PR 现可直接叠于最新 master(不再依赖之前未合并的 #2829)。 是什么问题 什么原因导致 影响范围与严重程度 怎么修复的 是否有回归问题
是否破坏缓存:不涉及(无游标/去重键/重试策略改动)。 是否改了设计方向:不变。仍是把各 native-lane 诊断从 terminal 收敛到 bili.log、并统一到单一共享 helper;差别只是现在直接叠在当前 master 上。 是否引入了新的配置:无(无新 env/config/默认值)。 判定:冲突已解除, |
[bot] 🏷 CI 状态更新:新 head 冲突已解除、 |
[bot] 🏷 已核查当前真实状态:这条「冲突」是 force-push 之后 GitHub 重算 mergeability 时的瞬时标记,不是现存冲突。实测:
无需再处理,PR 现已干净叠于最新 master、可直接合并(合并按规约由你操作)。若你的界面仍显示冲突徽标,刷新一下即可——GitHub 侧已是 clean。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.329-master.fbba1f7 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2831
Depends on #2829: this branch is based on #2829's head (
6461effc4). Once #2829 merges into master, this PR's diff shrinks automatically to my two commits below.Mechanism (same as #2827/#2829)
Native-lane diagnostic code runs inside the host agent process, whose stdout/stderr IS the interactive TUI terminal. A mid-session
console.*write lands on the physical screen, bypassing the host renderer (text appears on the cursor line — e.g. the input-box draft — until the next redraw). #2829 fixed the four fetch-chain sites; this issue tracks the remaining facets across the other native lanes.What changed
src/agent/host-log.ts:logHostEvent(level, origin, msg)— best-effort append to the sharedbili.log(proxy line grammar<ISO> [<level>] [v=<ver>] <origin> <msg>; reopens by path on every call so the proxy's 10MB rotation can never strand a writer).fetch-chain/index.ts: fix(#2827): route native fetch-chain diagnostics to bili.log instead of console.* #2829's locallogChainEventnow delegates to the shared helper (no behavior change).dsh-native.ts:persistClientEvent()delegates to the shared helper with byte-identical line format; the terminal-side copy was removed from every double-written site; the previously missing file copy was added formanifest registration failed.console.*diagnostic in the native lanes moved to the shared helper, origin[native-client]:native-intercept.ts×8 (signed-direct-forwarded, bootstrap timeout, held request, beforeSend-hook-failed ×2, no-live-proxy, proxy-not-ready [checklist], respawn-failed [checklist])pi.ts×24 (incl. the three/acp*sendMessage failedsites [checklist], dropped-tools re-assertion, manifest/register retries, compaction probe, omp setModel, fork adoption, wire-mode fallbacks, subagent self-registration)opencode-v2.ts×5 (window-limit degradation, forkAdopter callback, WS-handshake-hook unavailable, conditional-tool registration rejected [checklist], /acp command registration unavailable)opencode-native.ts×8 (conflicting configuration, proxy-unavailable direct, bootstrap failed, attach healthy/down/unhealthy, model-channel pinned, v1 baseURL rewrite notice)opencode.ts×2 (respawn failed, no-live-bili-proxy route warning)pi-native.ts×6 andomp-native.ts×5 (bootstrap/attach/rebinding + legacy bcp co-residence warning)native-ws-intercept.ts×4 (WS constructor threw [checklist], bootstrap-not-settled direct send, non-constructor replacement, third-party WS adopt)pi-subagents.ts×1 (unreadable user config)bili.log.Behavior changes (old → new) — mandatory disclosure
manifest registration failedKept on the terminal by design (startup-time or sole-channel deliverables, not diagnostics):
plugin active,v1: fetch patch installed,v1 active,v1: no live proxy at startup,v1: zod unavailable, extension-load-timeregisterProviderfailures,BILI_PROVIDER_REWRITESinvalid JSON./acp&/acp-cacherender-failure errors + missing-sessionID notices (opencode lanes): when rendering fails, the host render channel IS the only user-visible surface — silencing it would make total failure invisible.pi-subagentsacp.json deprecation warning (once per process at load; actionable config-migration notice).Product-decision items flagged for owner (the issue explicitly punts these): (a) whether the kept startup banners should also be demoted to file/debug-only; (b) I judged the two opencode-v2 capability warnings (WS handshake hook unavailable, /acp command registration unavailable) as diagnostics rather than user-must-see deliverables and routed them to the file — trivially reversible if the owner disagrees.
Tests
agent-providers,dsh-native,issue1569-window-stamp-and-anchor,issue1958-routed-warn,opencode-native,opencode-v2— mirroring fix(#2827): route native fetch-chain diagnostics to bili.log instead of console.* #2829's pattern innative-intercept-selfheal.test.ts.No config-surface change. No wire/message-shape change. No
kernel/change.