Skip to content

[PR] fix(#5706): opencode plugin startup lines go to bili.log; "opencode" config key no longer warned as unknown - #5710

Closed
ranxianglei wants to merge 2 commits into
masterfrom
2026-11-05_opencode-native-startup-noise
Closed

ranxianglei wants to merge 2 commits into
masterfrom
2026-11-05_opencode-native-startup-noise

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5706

What was wrong

Two symptoms reported on bili 0.1.212, opencode v1 native mode (bili plugin install opencode):

A. False config warning. "opencode": { ... } is a documented top-level config block (opencode.inline, CONFIGURATION.md) consumed by src/agent/opencode-native.ts, but it was missing from KNOWN_TOP_LEVEL_KEYS (src/config.ts) — so every config file carrying it logged [acp-config] ignoring unknown top-level config key(s): opencode at load.

B. Un-silenceable startup noise. The opencode plugin entries run INSIDE the opencode host process, where stdout/stderr IS the interactive TUI terminal. The v1 bootstrap printed 7 raw console.* lines on every startup (native entry: zod unavailable / fetch patch installed / no live proxy at startup / v1 active / legacy-lane notes; launcher-lane entry: plugin active / fetch patch installed), landing on the physical screen with no way to silence them.

Fix

Behavior change (old → new)

  • The 7 startup diagnostic lines above move from the opencode TUI terminal to bili.log only (shared state dir, see CONFIGURATION.md log section). They remain durably recorded and searchable — they just stop painting the screen un-silenceably.
  • Config files carrying the documented "opencode" block no longer emit the unknown-key warning at load. Genuinely unknown keys still warn exactly as before.

Tests

ci-check added 2 commits November 5, 2026 13:35
…ncode config block

FileConfig.opencode ("opencode": {"inline": true}, documented in
CONFIGURATION.md and consumed by src/agent/opencode-native.ts) was missing
from KNOWN_TOP_LEVEL_KEYS, so every config file carrying the documented
lane block logged "[acp-config] ignoring unknown top-level config key(s):
opencode" at load. Add the key to the mirror set and pin it in the
#2062 documented-surface test (that fixture reproduces the exact warning
without this fix).
…the TUI terminal

The opencode plugin entries run INSIDE the opencode host process, where
stdout/stderr IS the interactive TUI terminal — the seven raw console.*
calls in the v1 bootstrap (native entry: zod unavailable, fetch patch
installed, no live proxy at startup, v1 active, legacy-lane notes;
launcher-lane entry: plugin active, fetch patch installed) landed on the
physical screen on every startup and could not be silenced. Route them
through logHostEvent (src/agent/host-log.ts — bili.log only, never the
terminal), the same channel every other native lane moved onto in
#2827/#2831; message texts stay byte-identical, only the channel changes.

New regression pin (tests/issue5706-opencode-host-console.test.ts) asserts
both directions: neither entry file may contain a raw console.* call, and
every relocated diagnostic must still exist riding logHostEvent (a fix
cannot just delete the line).
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-05_opencode-native-startup-noise (a6f0b2d)

Latest build — install this exact version

npm install -g billion-context@0.0.8205-pr.5710.d91a3b6

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
a6f0b2d billion-context@0.0.8205-pr.5710.d91a3b6 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5710.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(#5706): opencode plugin startup lines go to bili.log; "opencode" config key no longer warned as unknown [PR] fix(#5706): opencode plugin startup lines go to bili.log; "opencode" config key no longer warned as unknown Nov 5, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

定性:继承性 master 红,非本 PR 引入。本轮未改代码、未 push(没有可合的东西)。

  1. 是什么问题:本 PR 的 10 个 test lane 全红,但逐个 job 拉日志取证后确认:所有失败都来自 master 自身已有的红测试 + 一类负载 flake,与本 PR 改动无关。
  2. 什么原因导致的:master(0aace2f20,即本 PR base)当前自带三族红(CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 floor 934–937 已登记并复现):① dsh catalog BLOCKED-ref(tests/issue2419 / issue2446 套件的「stamps the guard onto the effective config」子测试,×10 shard 全中);② [Bug] dsh 车道切模型 fork 出的 _sub: 会话不继承父会话 fold 块:上游上下文从 ~83K 瞬间膨胀到 794K、命中归 0、节省转负(0.1.187/0.1.188) #2817 cross-wire persona fold 断言漂移(commit 01fcc5d 引入的通用 dsh single-shot sidecar gate 改变了请求计数,确定性红 ×3:ubu22-s1/ubu24-s1/win22-s4);③ [Bug][dsh] Plugin lane performs a full re-parse and resends the entire body every round (81 MiB → hundreds of MB AST), w | [Bug][dsh] plugin 车道每轮全量解析重发 body(81 MiB→数百 MB AST)是 #5403 OOM 的生产者:用水位线断言替换逐条复核,服务端只解析新增尾段 #5418 watermark fastpath A/B 时序 flake(×3:ubu22-s1/ubu24-s1/win22-s2)。另有一条 ubu22-s2 独有的 msgid-lane-flow「pin carries client ids」3!==4——同一文件在同一树上的 ubu24-s2 全绿,判定为 settle-race 负载 flake(CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 floor 903 家族),不是确定性失败。
  3. 影响范围与严重程度:对本 PR 零外部影响——PR 自带的两个回归钉(opencode native plugin: un-silenceable startup console.log noise + "opencode" config key falsely warned as unknown #5706「bootstrap/launcher entry keeps the TUI terminal clean」×2、[config] misplaced/unknown top-level keys are silently ignored — root-level promptPack does nothing without any warning #1815 unknown-key 提示套件)在 ubuntu/windows 共 6 处 shard 全部通过。被卡的只有 CI 门禁本身,属 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 正在收敛的 master 红问题域。
  4. 怎么修复的:本 PR 侧无需修。按协调纪律核对 ci-fixes:其 tip(668c1ff3d)已经由 [PR] fix(incremental-lane): forward client end-to-end headers instead of a credential-dropping allowlist #5661 合入 master,是本 PR base 的祖先,merge origin/ci-fixes 为空操作,因此不产生任何 push。master 侧修复归哨兵/ci-fixes 车道:[Bug] dsh 车道切模型 fork 出的 _sub: 会话不继承父会话 fold 块:上游上下文从 ~83K 瞬间膨胀到 794K、命中归 0、节省转负(0.1.187/0.1.188) #2817 已在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599(floor 934)列出 A/B/C 选项等 owner 拍板(推荐 A:更新该测试的请求计数断言 9→8 等,test-only);BLOCKED-ref 与 [Bug][dsh] Plugin lane performs a full re-parse and resends the entire body every round (81 MiB → hundreds of MB AST), w | [Bug][dsh] plugin 车道每轮全量解析重发 body(81 MiB→数百 MB AST)是 #5403 OOM 的生产者:用水位线断言替换逐条复核,服务端只解析新增尾段 #5418 由哨兵统一处理。
  5. 是否有回归问题:无。本 PR diff 仅触碰 src/agent/opencode-native.ts、src/agent/opencode.ts、src/config.ts 加两个测试文件,与全部失败路径(dsh catalog、persona fold 统计、watermark fastpath、msgid lane)零交集;且这些失败已在干净 master 上独立复现(CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 floor 934/935/937,同日、同 base sha)。
  6. 是否破坏缓存:不涉及(本轮未改任何代码)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。config.ts 那 3 行是把既有的合法顶层键 "opencode" 补进 KNOWN_TOP_LEVEL_KEYS 白名单以消除误报警告,不是新增配置键(该键自 opencode 车道启用起就一直存在,此前只是每次启动多打一行 unknown-key 警告)。

判定:本 PR 自身无 CI 问题,红灯 100% 继承自 master;ci-fixes 已完全包含在本 PR base 内,无增量可合。等 #4599 哨兵车道把 master 转绿(含 #2817 决策落地)后 CI 重跑即可,本 PR 侧不需要任何动作。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

PR #5710 审核结论:代码正确、可合入方向成立;CI 红全部为继承性 master 级失败(非本 PR 自致)。

独立读 diff / 既有行为 / 回归产出本结论,未照抄 issue。

中文结构化八问

  1. 是什么问题——两症状:A) 文档化的顶层 "opencode" 配置块在加载时被误报「未知 key」;B) opencode native 插件在宿主进程里用裸 console.* 打 7 行启动诊断,落在 TUI 终端且无法静默。
  2. 什么原因导致的——A) KNOWN_TOP_LEVEL_KEYS(src/config.ts)是 FileConfig 的运行时镜像,当初加 opencode 字段时漏同步这个 Set → 误报;B) v1 bootstrap 沿用了裸 console.*,而该进程的 stdout/stderr 就是 TUI 终端([Bug][Pi native/TUI] pi-web-access 共存提示 console.log 污染输入框画面,点击重绘后消失(0.1.193) #2827/[Bug][native lane] #2827 同机制的剩余面:其他 native 车道的会话中途 console.* 仍直写宿主终端 #2831 已把其它 native 车道迁到 logHostEvent)。两者都是根因层修复,不是堵症状。
  3. 影响范围与严重程度——仅 opencode native 车道用户;A = 纯日志噪音(warnUnknownTopLevelKeys 只 warn 不 drop,配置本身一直在正常工作);B = 每次启动 7 行不可关闭的屏幕噪音。体验瑕疵级,无功能损坏、无数据丢失、无 wire/缓存影响。
  4. 怎么修复的——A) 把 "opencode" 补进 KNOWN_TOP_LEVEL_KEYS(镜像对齐类型);B) 7 处 console.* 全改走 logHostEvent("info"/"error", "[native-client]", msg) —— 只写 bili.log、永不碰终端、best-effort try/catch、带 sink 级脱敏。消息文本逐字节不变,只换通道;无新 env / 无新 config knob。
  5. 是否有回归问题(逐项过既有行为):
    • config 未知-key 告警机制:保持——真未知 key 仍按原样告警(issue1815 套件覆盖),只是不再对文档化 key 误报。有意变更,已披露。
    • 7 条启动诊断:由「TUI 终端」迁「bili.log」,有意变更,已披露;仍持久可查。
    • 补充发现(诚实披露):v1 active (proxy ${origin}) 这行的 origin 现在会经过 logHostEvent 的 Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651 脱敏,所以 LAN-IP origin 在 bili.log 里可能被掩码显示(此前终端上是明文)。这是更安全的默认、与其它车道行一致,非回归。
    • wire/消息形状、fail-fast 语义、阈值/时序/输出格式:除上述披露外均未漂移。高危域(自动更新/dsh/lockfile/systemd/网络代理):均未触碰。
  6. 是否破坏缓存——不涉及(无任何缓存/重试/增量游标/去重键改动)。
  7. 是否改了设计方向——不变;沿用既有 logHostEvent 通道约定,未引入新机制。
  8. 是否引入新配置——无(明确不加 env/config knob)。

测试有效性:新增 tests/issue5706-opencode-host-console.test.ts 是真双向门(#3617)——负向断言两个 entry 文件不得再含裸 console.*(log|info|warn|error),正向断言每条被迁移的诊断仍须存在且骑在 logHostEvent( 上(防未来「清理」直接删行而非改道)。tests/issue1815-* 把 opencode: { inline: true } 加进文档面夹具,走真实 config 加载路径复现原误报。二者在 CI 上均通过(不在下述 10 个失败项内)。

CI 状态(关键):head a6f0b2d57 共 30 check,10 failed / 7 success / 13 skipped,mergeable_state=blocked。10 个失败的 test-shard job 全部收敛到 3 个继承性 master 级家族,与本 PR 的 5 文件 diff(opencode 启动日志 + 顶层 key 允许表)零交集:① BLOCKED-ref 家族(issue2419/2446/2447/2481-dsh-*「stamps the guard onto the effective config」)—— dsh-guard load-bearing;② #2817 crosswire persona fold(stats.requests 得 8 ≠ 9,由 01fcc5d68 single-shot sidecar gate 引入,待拍板选项 A);③ #5418 watermark fastpath(measured wire total null !== 2)timing-flake。证据:#4599 floor 934–938(今日五条独立记录)确认同一签名在干净 master 0aace2f20(= 本 PR merge-base)确定性复现,且同簇红于 #5700/#5703/#5708。我本地核验:origin/ci-fixes(tip 668c1ff3d)⊆ origin/master、git log origin/master..origin/ci-fixes 为空 → merge ci-fixes 是 no-op,无可推 sha(零 push)。

收工判定:代码侧 APPROVE(单模块小修、双向回归钉、diff 干净;§7.4 auto-merge 条件基本满足,唯一拦路 = 全局 CI 绿,而该绿被 master 继承红挡住,非本 PR 责任)。解锁路径:owner 合入 #4599 哨兵收敛(ci-fixes→master)+ 就 #2817 选项 A/B/C 拍板后,master 转绿,本 PR 重跑即绿。agent 不合 PR,等您操作。

Louie0806 pushed a commit to Louie0806/billion-context that referenced this pull request Nov 8, 2026
Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 8, 2026
…TS.md and the ranxianglei#5904 first-byte budget

Upstream delta 48ee6a7..3ac3e95 (83 files, 20 commits). The substantive ones:
- e3434a3 fix(ranxianglei#5904): phase-1 first-byte budget for upstream summary calls + watchdog/preflight logging
- b4a4026 docs(ranxianglei#5904): regenerate config artifacts for upstreamFirstByteMs + ledger entry
- 9492212 docs(ranxianglei#5904): align first-byte-knob comments and docs with shipped values
- c7db020 fix(opencode): route host console chatter to bili.log and teach the config key (PR ranxianglei#5710, closes ranxianglei#5706)
- 984d3dc fix(gate): opencode lane one-time warmup round for fresh storage dirs (PR ranxianglei#3497)
- 8f1fca8 docs: live architecture hub + module pages + file-map CI guard
- 2a15b5a docs: all 8 architecture module pages live
- 44faff0 docs: slim AGENTS.md (KDD text to reference/design-decisions.md, triage table to reference/triage.md)
- 6f4f248 docs: add docs/README navigation landing page, en+zh
- 3ac3e95 Merge pull request ranxianglei#5917

Conflict surface: only the four generated artifacts, all auto-merged. The lane's chat
row is still in the regenerated docs/configuration.md (line 294) after
`node tools/gen-config-docs.mjs generate`, and the docs fixed point holds.

kernel stayed at 0.0.187 and was rebuilt before measuring. Lane anchors intact:
src/server/relay.ts:2070 still calls `pipePluginJson(toClient, res, undefined,
prepared.protocol, ...)`, src/storage/mysql.ts:77 still exports MYSQL_SCHEMA_VERSION,
symbols unchanged (stripDriftResidue 6, isDraftDump 6, containsRenderTagText 21,
mayStartDegenerateRenderTag 6, DRIFT_BARE_MISMATCH 3, DRAFT_CLOSE_TAIL 3).

Gates: tsc 0, four guards 0, gen-config-docs fixed point.
Tests: issue5175 58/0, tag-echo 79/0, issue2190-degen-close 32/0, golden-storage-render 5/0,
storage-engine-proofs 12/0, native-compact-terminal 1/0, issue4666 2/0, and the three
new upstream suites: issue5904-upstream-first-byte 4/0,
issue5706-opencode-host-console 2/0, issue1815-unknown-top-level-keys 5/0.
@ranxianglei

Copy link
Copy Markdown
Owner Author

Closing: the fix landed on master as c7db020 "fix(opencode): route host console chatter to bili.log and teach the config key (PR #5710, closes #5706)" — every changed line of this branch is present on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode native plugin: un-silenceable startup console.log noise + "opencode" config key falsely warned as unknown

1 participant