Repository navigation
[PR] fix: stop takeover-broken banner false alarm from agentless sidecar lanes (#3651) - #3653
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4660-pr.3653.bff9c85This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3653.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 收到,开始审核 PR #3653。 查重:不重复。 无其他在途 PR/issue 修同一误报缺陷。相邻条目核对过:#3622(dsh-native takeover health 上 /__bili/status + 面板)是可见性功能扩展、#3593/#3581 是横幅机制本身(已合入)、#3578 是真失效形态的另一面——都不是本 PR 的重复。注意 #3622 与本 PR 同触 正在拉分支独立审 diff(不沿用 #3651 线程结论),随后按八问给完整审核意见。 |
…w finding on #3653) The paste-safe-sink commit swapped the fully-expanded ::1 literal (0:0:0:0:0:0:0:1) for 0:0:0:0 (fully-expanded ::), silently flipping two free-text edge cases vs master with no stated reason: expanded ::1 in prose would now be masked, expanded :: exempted. Restoring the original literal keeps this PR's log-mask change purely additive (export only).
…ew finding on #3653) The new floor test covered pure-none episodes only. If a later edit drops the (changed && state === threw) clause, a silent sub-floor none episode flipping to an internal error would stay silent until doubling — exactly the #3581a contract this PR claims to preserve. Extended the #3651 test: sub-floor none x2 → threw must report immediately ({state:threw, refusals:7}).
…w finding on #3653) The paste-safe-sink commit swapped the fully-expanded ::1 literal (0:0:0:0:0:0:0:1) for 0:0:0:0 (fully-expanded ::), silently flipping two free-text edge cases vs master with no stated reason: expanded ::1 in prose would now be masked, expanded :: exempted. Restoring the original literal keeps this PR's log-mask change purely additive (export only).
…ew finding on #3653) The new floor test covered pure-none episodes only. If a later edit drops the (changed && state === threw) clause, a silent sub-floor none episode flipping to an internal error would stay silent until doubling — exactly the #3581a contract this PR claims to preserve. Extended the #3651 test: sub-floor none x2 → threw must report immediately ({state:threw, refusals:7}).
3340cc7 to
8725583
Compare
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决:分支已 rebase 到最新 master( 结构化八问
收工判定:冲突闭环,等 CI 绿后即可按原 PR 描述合入(仍需人工 merge)。 |
(ai: vllm-qwen/qwen3.8-27b) 独立审核完成(⓪ 结论由 diff 与代码路径独立产出,未复读 #3651 侧分析)。审核中在 PR 分支直接修了两处小问题(独立标注 commit),另立了一个无关发现(#3656)。 审核过程摘要
审核中发现的两处小修(已推 PR 分支,独立 commit)
行为变更清单(独立核验,与 PR 正文表格一致)
已知残余权衡(可接受):每 worker 生命周期合法拒绝 >3 次的车道仍会亮 banner——现场证据 sidecar ≤2 次/worker,floor=3 留了一倍余量;若未来出现合法拒绝更多的宿主,调 回归审查(既有行为清单,逐项)
测试与 CI 状态:本地 typecheck clean + 定向套件 78/78(含扩展后的 #3651 测试、log-mask 全套)。CI:原 head 无关发现(已单独立项,不阻塞本 PR):手动触发的 结构化八问
判定:核心 test matrix 转绿后可合(e2e 车道已在 rebased head 全绿,原 head 曾全绿;两处审核小修已含在分支里)。合并是 human-only——CI 转绿后请自行合并:#3653 |
(ai: vllm-qwen/qwen3.8-27b) 增量复核:第三个标注提交 对第三提交的独立审核(不沿用上一轮结论,逐条重验):
八问(本轮增量)
行为变更披露(增量):非 web dsh profile 启动日志从「静默」变为「每进程一行 durable trace」(纯增量可观测性)。 CI 终态:
判定:内容侧三轮审核全部通过(floor 机制 + 两处审核修正 + 第三提交),分支头全绿。merge-ref run 转绿后即可合,合并仍由人工执行。 |
In-passing fix found while working #3651: the paste-safe sink only existed on the proxy side. Host-side event lines ([dsh-client]/[native-client] persistClientEvent) were written verbatim, so a user pasting bili.log into a public issue leaked real non-public upstream hostnames (opencode.ai, zcode.z.ai) even though the proxy-side lines showed <private-host>. logHostEvent now applies maskUrlsLoopbackSafe(maskIpsInText(redactSecretsInText(...))) with loopback hosts exempt so attach-target/pinned-origin diagnostics keep identifying bili itself.
…ion floor (#3651) The #3581 takeover-broken banner fired on the FIRST none-state refusal, but by-design agentless lanes (dsh's title-gen sidecar et al.) refuse a handful of small one-shot calls per host lifetime and can never recover — field shape from #3651: exactly one refused sidecar call per short-lived worker boot while the main conversation compressed fine, banner lit on every boot, 'restart the host' advice could not help. none episodes now escalate only past ATTR_NONE_ESCALATION_FLOOR (3 cumulative refusals), then keep the doubling cadence; threw keeps its original #3581a contract (first refusal immediate + doubling) since an exception in the attribution lookup is internal error, never legitimate agentless evidence. A genuinely broken takeover refuses every model call, so any real episode crosses the floor within the first user turn.
…w finding on #3653) The paste-safe-sink commit swapped the fully-expanded ::1 literal (0:0:0:0:0:0:0:1) for 0:0:0:0 (fully-expanded ::), silently flipping two free-text edge cases vs master with no stated reason: expanded ::1 in prose would now be masked, expanded :: exempted. Restoring the original literal keeps this PR's log-mask change purely additive (export only).
…ew finding on #3653) The new floor test covered pure-none episodes only. If a later edit drops the (changed && state === threw) clause, a silent sub-floor none episode flipping to an internal error would stay silent until doubling — exactly the #3581a contract this PR claims to preserve. Extended the #3651 test: sub-floor none x2 → threw must report immediately ({state:threw, refusals:7}).
…web-app profile (#3651) The web-profile note was the only confirmation that the load-time compaction-disable overlay took effect, and it is scoped to profiles bundling @deepseek-ai/dsh-web-app — every other profile boots silently even though registerCompactionDisable runs unconditionally. Field triage (#3651) could not tell "overlay registered" from "profile shape unconfirmed" because of this gap. One once-per-process durable client event now records the non-web-app case (with the #2474 fallback pointer and the #2028 allowDshCompaction interplay noted). Closes nothing by itself — third labeled commit of the #3651 PR.
…3651) Owner contract from the #3651 thread: normal interceptions must stay silent; a report only exists for something broken, diagnosable, and actionable. - agentless 'none' refusals (by-design sidecar/agentless lanes) NEVER call reportAttributionHealth anymore — the interim escalation floor is dropped; they keep their durable per-endpoint masked log line and local counters (recovery still resets them). They can no longer raise the banner. - 'threw' reports now carry diagnostics: the error text (<=300 chars), the masked endpoint (<=200 chars, loopback origins verbatim), first-seen time and count — end to end (plugin -> admin handler -> status store -> wire). - The banner is reworked around that payload: what failed (error line), impact scope (since when, how many requests went direct), concrete remedy (restart the host), and copy-diagnostics / submit-diagnostics buttons (prefilled GitHub issue via the existing /__bili/diagnostics endpoint). - Loopback exemption moved into shared maskUrlForDiagnostics/maskUrlsForDiagnostics (verbatim, not re-serialized: URL.pathname would append '/' to pathless URLs and drift byte-pinned lines); host-log events use it too.
Internal-only after the loopback exemption moved into maskUrlForDiagnostics; no external importer remains.
…ch gate (#3653) Rebase artifact: master's #3806 made the web-profile note conditional on the #3354 overlay latching (cordis on/reflect present); a hook-less host now gets the ARMED alarm instead. The bare subcase keeps its original purpose (the non-inject direct profileContext bundles path) by supplying minimal no-op hooks so the passive note is what's asserted.
813e18e to
887e481
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.653-master.c4f2518 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3651
What
The #3581 visibility banner 「接管已失效:模型请求正在直连(不压缩)…」 fired as a false alarm on dsh desktop workers: by-design agentless lanes (dsh's title-gen sidecar et al.) refuse a handful of small one-shot calls per worker lifetime with no active initiator, and #3581 escalated that FIRST refusal immediately. Field evidence in #3651: exactly one refused sidecar call per short-lived worker boot while the main conversation compressed fine — the banner lit on every boot and its "restart the host" advice could never help.
The #3651 thread then set the reporting CONTRACT this PR converges on (owner directive): normal interceptions must stay silent; a report only exists for something broken, diagnosable, and actionable — with error text, impact scope, remedy, and a diagnostics-submission path to GitHub.
Changes (four labeled commits, plus two review fixes already on the branch)
src/agent/host-log.ts,src/log-mask.ts): the paste-safe sink previously existed only on the proxy side; host-side event lines ([dsh-client]persistClientEvent) were written verbatim, which is how real non-public upstream hostnames leaked into the public log pasted in Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651. Host-side events now get the same treatment: non-public hosts →<private-host>, URL query strings dropped, loopback hosts kept verbatim so attach-target/pinned-origin diagnostics still identify bili itself.src/agent/dsh-native.ts): the web-profile note was the ONLY confirmation that the load-time compaction-disable overlay took effect, and it is scoped to profiles bundling@deepseek-ai/dsh-web-app— every other profile booted silently even thoughregisterCompactionDisableruns unconditionally (field triage of Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651 could not tell "overlay registered" from "profile shape unconfirmed"). One once-per-process durable client event now records the non-web-app case, pointing at the fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474 snapshot fallback and the 在bili网页配置界面支持关闭和开启dsh的自动压缩功能 #2028 allowDshCompaction interplay.noneepisodes (src/agent/dsh-native.ts) — SUPERSEDED by commit 4: agentless refusals reported only after 3 cumulative, then doubling. Kept in history because the owner's contract comment landed mid-review; commit 4 removes the floor entirely per the contract ("正常拦截了就不应该报告").src/agent/dsh-native.ts,src/agent/shared.ts,src/plugin.ts,src/server/attribution-status.ts,src/web/client.ts,src/web/i18n.ts,src/log-mask.ts), per the owner's four-point directive in Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651:none) refusals NEVER callreportAttributionHealthanymore — no floor, no cadence. They keep their durable per-endpoint masked log line and local counters (recovery still resets them) and can no longer raise the banner under any circumstances.threwreports (the attribution lookup itself throwing — a genuine bug-shaped failure) now carry the error text (≤300 chars) and the masked endpoint (≤200 chars, loopback origins verbatim) end-to-end: plugin → admin handler → status store → wire. Cadence unchanged from #3581a (first refusal immediate, then doubling) plus the give-up latch./__bili/diagnosticsendpoint (prefilled GitHub issue). zh/en copy rewritten accordingly.maskUrlForDiagnostics/maskUrlsForDiagnosticsinsrc/log-mask.ts(used by both the endpoint field and host-log events); loopback URLs are returned VERBATIM rather than re-serialized, becauseURL.pathnameappends/to pathless URLs and would drift byte-pinned local-origin lines.Behavior changes (disclosed)
noneepisodethrewepisodethrewepisodes can now degrade an entry)[dsh-client]etc.)No new config surface. No request-routing change — only when the degradation report fires and what it carries. Wire addition is additive (optional
error/endpointfields on the existing/__bili/plugin/attributionpayload; older proxies ignore them).Tests
nonerefusals produce ZERO proxy reports and leave local health untouched, while the durable masked log line still fires; the none→threw flip reports IMMEDIATELY with{error, endpoint}diagnostics; recovery resets counters and reportsok.threwcadence (first-refusal immediate + doubling at 2 + give-up latch), pinning that the contract change does not touch the broken-takeover path./__bili/statusattribution entry now surfaceserrorand a verbatim loopbackendpoint.log-masktests: loopback verbatim (127.x / localhost / [::1]), non-public masked, public kept, unparseable fragments pass through — both function-level and text-level.web-i18ncatalog test green (new keys present in both locales, placeholder parity, no Han in en).tests/dsh-native.test.ts+tests/web-i18n.test.ts+tests/issue3581-attribution-health.test.ts+tests/log-mask.test.ts= 92/92); full-suite verdict = CI on pushed head.fix(log-mask)restores master's expanded IPv6 loopback literal (keeps the masking change purely additive);test(dsh-native)pins the none→threw immediate-report invariant across state transitions.