Repository navigation
[PR] fix(web): conflict reports cover non-dsh clients — codex log signatures + observed client UAs - #4651
[PR] fix(web): conflict reports cover non-dsh clients — codex log signatures + observed client UAs#4651ranxianglei wants to merge 0 commit into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6160-pr.4651.189a3f0This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4651.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重结论:不重复——但存在一个同 issue 的并行 PR。 检索 open+closed issues/PRs(按失败签名与机制,不只标题):与本 PR 同机制的只有 #4650(同日、提交仅差 4 分钟、同 base master@bd29924d4、两者都写 两个 diff 我逐行读完了,推荐:保留本 PR(#4651)、关掉 #4650,理由:
一点坦率说明:严格按「先来后到」#4650 更早 4 分钟应保留,但它是被严格包含的较弱实现(issue #4649 自己的建议修法写的就是「有界最近观测 UA map」,即本 PR 的设计),保留它只会留下已知缺口。若你坚持先来后到,替代路径是把第 4 条模式+注册表移植进 #4650 分支再关本 PR——但那等于换个分支名重做一遍,我不推荐。 CI 现状:master 本身当前是红的(bd29924 全部 test shard 失败;#4599 总控里有 known born-red 记录,如 generation-boundary 调用参数数、unused-exports)。本 PR 失败的 shard 是 master 失败集合的子集 → 判为继承性红,不是本 PR 代码引入;master 转绿后重跑即可,无需在本分支排查红因。 代码审查已完成:方向正确(修的是 dsh-only 覆盖这个根因,不是症状层打补丁)、5 个 emitter 逐一与实际日志站点对上、未发现回归。完整八问结论随后一条评论给出。 标签:bug / codex / scope/ui / p3(缺陷修复;受益客户端为 codex 车道;web 诊断展示面;严重度=triage 摩擦,不影响代理功能本身)。 |
(ai: vllm-qwen/qwen3.8-27b) PR #4651 审查完成 —— 判定:代码可合入;待你拍板两件事(与并行 PR #4650 的收敛、CI 转绿后重跑)。 八问:
代码质量(⑤b 清单):命名达意、无常量外的魔法数字、无死代码、注释讲为什么(逐条带 issue 号)、风格与仓库一致(下划线测试导出沿用 测试有效性(④):7 个测试全有牙——双向 gate(正例站点全命中 / 负例行不进来)、上限钉死(10→8 驱逐、300→120 截断、24→12 显示上限+溢出注记)、家族阶梯(含 #645 token 级、#1641 mid-token 负例、#760b mcp 排除)、publish 纪律。此 bug 回归时这些测试抓得住。我本地独立复跑:新增 7/7 + enrichment 6/6 + redaction 5/5 全绿,typecheck clean。 diff 整洁度(⑤):4 文件 +342/-6,单 commit,每一行都与本修复相关,无跑题/空白噪音/lockfile churn。 CI:红是继承的——master@bd29924 本身全 shard 失败(#4599 总控有 born-red 记录),本 PR 失败 shard ⊆ master 失败集合,master 转绿后重跑即可。 结论:八问无拦项,代码审查通过,可合入。剩两个前置动作归 owner:①拍板与 #4650 的收敛(我的建议:保留本 PR、关 #4650,理由见上一条评论);②master CI 转绿后对本分支重跑一次拿全量绿。 |
…es + observed client UAs (#4649, picked up from PR #4651) Rebased onto current master: hostClientVersionLines now carries master's #5146 no-bare-?s profile wording inside the if/else restructure this fix introduced (observed-UA lines stay outside the early-return path). Conflicts in handle.ts import block resolved as union (billing + ua registry imports).
…es + observed client UAs (#4649, picked up from PR #4651) Rebased onto current master: hostClientVersionLines now carries master's #5146 no-bare-?s profile wording inside the if/else restructure this fix introduced (observed-UA lines stay outside the early-return path). Conflicts in handle.ts import block resolved as union (billing + ua registry imports).
…es + observed client UAs (#4649, picked up from PR #4651) Rebased onto current master: hostClientVersionLines now carries master's #5146 no-bare-?s profile wording inside the if/else restructure this fix introduced (observed-UA lines stay outside the early-return path). Conflicts in handle.ts import block resolved as union (billing + ua registry imports).
PR #4650 and the already-merged #4651 both modified the same #4649 lines (non-dsh client conflict-report coverage). Resolution: - #4649 content resolved to master's UA-registry implementation (observedUaLines / recentClientUas / OBSERVED_UA_LINES) — the PR's clientHint-based variant is superseded by #4651. - Preserved this PR's unique contribution: the client-agnostic 'zombie fold reap' (#2695) signature in CONFLICT_LOG_PATTERNS (#4688) and its regression test (converted to the now-async buildDiagnostics API). - Dropped the two clientHint #4649 tests (redundant with master's dedicated tests/issue4649-conflict-report-client-coverage.test.ts) and the now-unused session import. Net diff vs master: the #4649 doc comment + zombie-reap pattern + #4688 test.
b6a9c57 to
dd0ef22
Compare
Closes #4649
What was broken
The web-panel diagnostics blob (#3040/#3611) recognized ONLY dsh clients:
CONFLICT_LOG_PATTERNS(src/web/diagnostics.ts) was all dsh signatures — a conflict report from a codex session (ledgerclients: codex, Compression conflict banner (bili v0.1.202, node v22.22.1, linux-x64) #4648) printed(no matching lines in the current log pair): not one of codex's compaction-evidence log lines matched.--- host client versions ---section read only dsh profile bundles (DSH_REPORT_PACKAGES) and early-returned on machines without dsh profiles — so a codex report carried no client version at all, forcing manualcodex --version+ log round-trips for every such report.Fix (host-side only — no kernel, no config surface)
① Codex evidence chain in
CONFLICT_LOG_PATTERNS— one entry per distinct log site, byte shapes taken from the actual emitters:codex compaction_trigger request not intercepted— the not-intercepted forward (src/server/handle.ts);codex local auto-compaction detected— inline auto-compact detection + rebase (bili 对 Codex 原生压缩的拦截分支在本会话没进入(貌似自己截断自己了) #3008/[bug] Codex local auto-compaction can destroy existing bili fold substrate instead of rebasing #2372);codex compact intercepted— both forge forms (trigger form AND endpoint form share the prefix);codex compact forge failed— forge failure passthrough.All four live in
src/server/prepare-responses.tsexcept the first. Pre-existing dsh entries untouched.② Bounded observed-UA registry (
src/client-ua-registry.ts, new) — the proxy sees the requesting UA on every model request but never recorded it. Now:recordClientUa(req.headers)runs once per model request inhandleRequest(every request, unlike the first-seen-onlyclientHintblock beside it);x-bili-pluginagent (mcpexcluded, #760b) > header sniff (sniffScanClient: claude/opencode) > codex UA shape (isCodexClient, incl. the [Question] Previously, Codex displayed the context window size after compression, but it now appears to show an unexpected/incorrect value. #645 token-level fallback) >other;host client versionssection publishes up to 12 lines (display budget) after the dsh part and OUTSIDE the no-dsh-profiles early-return path — a machine with zero dsh profiles (the Compression conflict banner (bili v0.1.202, node v22.22.1, linux-x64) #4648 case) still gets its observed client versions; empty registry prints an honest(none recorded by this process yet)note;redactForPublishpublish net ([security][web] Storage diagnostics publish raw log lines and absolute paths | 存储诊断公开报告泄露本地路径和未脱敏日志 #4427) that already covers the whole blob (credential shapes scrubbed, private hosts masked, home paths ~-normalized).Behavior changes (explicit, per policy)
observed client user-agents:block underhost client versions(≤12 lines + overflow note). Purely additive to the blob; no existing line moves or changes.Tests
New
tests/issue4649-conflict-report-client-coverage.test.ts(7 tests, hermetic):[acp-usage],[storage], the codex window-clamp alignment line) stay out; dsh coverage unregressed;Local: targeted suites green (new 7/7, web-diagnostics-enrichment 6/6, web-conflict-banner + conflict-lifecycle + conflict-remediation 44/44); typecheck clean; build + dist gates + unused-export gate clean. Full-suite verdict: remote CI on this head.