Skip to content

[PR] fix: route Claude Desktop notification classifier through the side passthrough (#4840) - #4843

Open
ranxianglei wants to merge 9 commits into
masterfrom
2026-10-26_claude-notification-side-lane
Open

ranxianglei wants to merge 9 commits into
masterfrom
2026-10-26_claude-notification-side-lane

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What & why (#4840)

Claude Desktop's Code-tab notification classifier fires a one-shot side call under the MAIN conversation id: a fixed system sentence + exactly one freshly-built user blob carrying four ordered status labels (Current state: / Tool calls so far: / User's most recent ask: / Assistant message tail (last N chars):), no tools, max_tokens=3072.

Pre-fix none of the existing signals saw it — the <=200 budget gate in isSideRequest missed 3072 and no dedicated shape existed — so it rode the full pipeline as a main turn:

  • its usage sample replaced the main baseline (issue: 85,236 → 12,149),
  • its model (Haiku) became the session's last model,
  • its single message clobbered the persisted snapshot + ledger,
  • restoreOutputBudget seeded outputBudgetHighWater from its 3072 budget.

Fix

Add isClaudeNotificationRequest (src/server/side-request.ts) — a pure shape predicate following the #4438 auto-review / #2503 title discipline: fixed system prefix on any wire carrier (systemCarrierTexts) + exactly one plain-text user message carrying the four ordered labels (the last label's (last N chars) count matched by regex, never hardcoded); no-tools veto; explicit agent=main vetoes at the caller. A real main turn can never match: it carries a tools surface and multi-turn history, and never carries these classifier labels.

Wire it into four sites in src/server/handle.ts:

No kernel change, no new dependency, no config surface.

Behavior change (old → new)

The notification-classifier request was previously treated as a main request — it mutated the main session's usage baseline, last model, persisted snapshot/ledger, and output-budget high-water. It is now treated as a side request: forwarded verbatim through the #388 passthrough with no kernel-state mutation, no tool/nudge injection, and no output-budget restore. This is the intended fix — the classifier is an auxiliary one-shot call that must not touch main-session state. Explicit agent=main still outranks the shape (unchanged), and ordinary Haiku turns (tools + multi-turn history) still ride the full pipeline (covered by a control test).

Tests

New tests/issue4840-claude-notification-side-lane.test.ts (8 tests): unit positive/negative matrix for the shape matcher, isSideRequest gap documentation, resolveSideLane label, plus three e2e lanes (no-pollution + high-water untouched; normal-Haiku-stays-main control; explicit-main-veto). Updated the #1440 boundary allowlist in tests/side-lane-invariants.test.ts for the new symbol (with the category justification that guard requires).

Local: typecheck clean; new suite + websearch/dsh-title/truth-table/isolation/invariants suites (86 tests) + lane-decisions-matrix (90 tests) all green on the rebased head. Full-suite verdict = CI.

Closes #4840

…ssthrough (#4840)

Claude Desktop's Code-tab notification classifier fires a one-shot side call under the MAIN conversation id: a fixed system sentence + exactly one freshly-built user blob carrying four ordered status labels, no tools, max_tokens=3072. Pre-fix the <=200 budget gate in isSideRequest missed it and no dedicated shape existed, so it rode the full pipeline as a main turn - its usage sample replaced the main baseline, its model became the session's last model, its single message clobbered the persisted snapshot + ledger, and restoreOutputBudget seeded outputBudgetHighWater from its 3072 budget.

Add isClaudeNotificationRequest (a pure shape predicate: fixed system prefix on any wire carrier + exactly one plain-text user message carrying the four ordered labels, tail length matched dynamically; no-tools veto; explicit main intent vetoes at the caller). Wire it into sideRequestLike (verbatim keying), sideIntent (side passthrough), the restoreOutputBudget skip, and the side-lane reason label.

Closes #4840
@ranxianglei ranxianglei changed the title fix: route Claude Desktop notification classifier through the side passthrough (#4840) [PR] fix: route Claude Desktop notification classifier through the side passthrough (#4840) Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-26_claude-notification-side-lane (f667087)

Latest build — install this exact version

npm install -g billion-context@0.0.10766-pr.4843.d6c6152

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
f667087 billion-context@0.0.10766-pr.4843.d6c6152 build
046d30b billion-context@0.0.10691-pr.4843.d4c1da9 build
b78d27c billion-context@0.0.10519-pr.4843.ef6309d build
66fc95d billion-context@0.0.10385-pr.4843.df71593 build
d554f6e billion-context@0.0.10181-pr.4843.59f2b18 build
b254fa5 billion-context@0.0.9295-pr.4843.b2687e8 build
ff9f955 billion-context@0.0.6255-pr.4843.61d81b9 build
c78d351 billion-context@0.0.6252-pr.4843.aa15fca build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。 镜像库检索了 "notification classifier"、"haiku 3072"、"baseline pollution sidecar" 等关键词(open+closed),无同机制条目。相关但不同的既有 issue:#2648(同一个通知分类器因 ACP 注入导致上游 400,机制不同)、#3744/#3746(Threads 面),均不覆盖本 PR 的「分类器被当主轮污染会话状态」问题。

标签: bug + claude + scope/wiring + p1(理由:Claude Desktop 车道的请求管道接线缺陷;p1 依据 owner 2026-10-19 修订——侧调单条消息覆写持久化 snapshot+ledger,属「重载丢消息」数据丢失类)。

PR 审核进行中:diff 已逐文件读完(4 文件 +415/-10,无 kernel 改动、无配置面、无新依赖),正在 PR head c78d351 上做定向测试验证;CI 快速通道已绿,全量 test shards(ubuntu/windows × node22/24)仍在排队/运行中,跑完后给出八问结论与合并判定。

@ranxianglei ranxianglei added bug Something isn't working claude p1 scope/wiring labels Oct 26, 2026
Review supplement to the #4843 fix: the issue lists four pollution
symptoms; the e2e no-pollution lane asserted three of them (usage
baseline, snapshot/counter, high-water) but relied on structural code
position alone for the fourth — the notification's Haiku model becoming
the session's last model (assigned at src/server/handle.ts main-pipeline
config block, after the side-lane early return). Assert it explicitly so
a future refactor that moves that assignment above the lane decision is
caught by the regression test instead of shipping silently.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核进展:diff 审核完成,定向验证通过,并已补一个 review supplement commit。

顺手小修(独立标注 commit ff9f955):issue #4840 列了四个污染症状,e2e no-pollution lane 显式钉住了三个(usage baseline、snapshot/请求计数、high-water),第四个——「通知的 Haiku 模型变成会话 last model」——此前只靠代码位置结构性保证(src/server/handle.ts:2357 的 lastModel 赋值在主管道配置块里、位于 side-lane early-return 之后),没有断言。已补两行断言(主轮后 lastModel=MAIN_MODEL;通知后仍为 MAIN_MODEL),本地跑过 8/8 绿。这样将来若有人把那行赋值挪到 lane 决策之前,回归测试会抓住而不是静默放行。

本地定向验证(PR head):tests/issue4840-claude-notification-side-lane.test.ts + tests/side-lane-invariants.test.ts + tests/lane-decisions-matrix.test.ts 共 109 测试全绿;typecheck 干净。PR head 相对 master 领先 1 commit、落后 0(无需 rebase)。

CI:新 head ff9f955 上静态门(kernel-guard / config-surface-guard / lane-guard / lock-sync / version-guard 等)已全部绿,全量 test shards(ubuntu/windows × node22/24)运行中,完成后给八问结论与合并判定。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核结论(八问)

CI 全绿(新 head ff9f955,含我补的测试 commit):11 个 test shards(ubuntu/windows × node22/24)全 success,static-gates ×2、build-artifact、mysql-contract 及全部静态门(kernel-guard / config-surface-guard / lane-guard / lock-sync / version-guard / pi-subagents-guard / lifecycle-ledger-guard / docs-* / unused-exports 等)全 success;e2e 车道按文件门设计跳过。本地定向:三个相关套件 109 测试全绿 + typecheck 干净;head 相对 master 落后 0,无需 rebase。

  1. 是什么问题:Claude Desktop Code 标签页的「通知分类器」——一个挂在主会话 id 下的一次性侧调(固定 system 句 + 单条四标签 user blob、无 tools、max_tokens=3072)——被 bili 当成主会话的正常主轮处理了。
  2. 什么原因导致的:既有侧调识别只有两类信号——输出预算 ≤200(标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388/[bug] bili dsh 长会话中 max_output_tokens 被压到 ≤200,主请求被误判为 side request 并绕过压缩 #546)与显式 agent 意图(opencode v2 title-gen requests get injected with compression philosophy (misclassified by isTitleGen) #1699),外加 dsh title/auto-review 两个客户端专属形状谓词。3072 超预算门、Claude Desktop 没有专属形状谓词 → 分类器调用漏进完整管道,产生四处污染:usage 样本替换主基线(85,236→12,149)、Haiku 成为会话 last model、单条消息覆写持久化 snapshot+ledger、restoreOutputBudget 用 3072 播种 outputBudgetHighWater。
  3. 影响范围与严重程度:p1。触发条件:Claude Desktop Code 标签页流量经 bili 代理 + agent 运行到通知分类器开火。后果属「重载丢消息」数据丢失类(持久化快照被侧调单条消息覆写),另有基于错误基线的 nudge/输出钳制决策漂移。
  4. 怎么修复的:新增纯形状谓词 isClaudeNotificationRequest(src/server/side-request.ts)——任意 wire carrier 上的固定 system 前缀 + 恰好一条纯文本 user 消息携带四个有序标签(末标签的 (last N chars) 计数用正则匹配、不硬编码)+ no-tools 否决 + 调用点显式 agent=main 否决优先;接入既有 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 side passthrough 的四处(verbatim 会话键控、sideIntent 路由、restoreOutputBudget 跳过、日志标签)。走的是 [Bug][dsh] 0.1.204: auto-review side request collides with the main session → false native-compaction rebase → aux usage skips #453 clamp → permanent upstream 400 #4438 auto-review 的纪律:形状自带客户端证据、不加 header 门。真实主轮不可能命中(带 tools 面 + 多轮历史,且不会带这些分类器标签)。
  5. 是否有回归问题:无。逐项过过的既有行为:isSideRequest 未动(历史 reason 字符串 max_tokens<=200 有字节稳定控制测试钉住);主管道唯一改动是 restoreOutputBudget 跳过守卫加一个析取项(仅在形状命中时生效);persona-fork 各站点本就由 !sideRequestLike 门控,新析取项只对恰好命中该形状的请求生效(无证据表明 dsh 等宿主发这种形状,且真发了走 side passthrough 也是正确行为);resolveSideLane 纯函数签名未变、标签为增量参数;audit: 全仓冗余审计与重构计划——server.ts 解体、客户端矩阵去重、死代码、AGENTS.md 模块图腐化 #1440 allowlist 按该守卫要求更新并附类别理由。高危模式逐项清:无阈值漂移(SIDE_REQUEST_MAX_TOKENS=200 未动)、无 fail-fast 变吞错、无输出格式变化(日志行为增量)、无缓存/重试/游标策略变化。过抑制方向([bug] #3177 的 DSH compress-surface 抑制在「agent 能看到 bili 工具」的 DSH 环境下误伤:nudge 与 compress 系统提示被永久关闭 #3401 类事故)有显式控制测试:普通 Haiku 轮(tools+历史)仍走主管道、注入照常。
  6. 是否破坏缓存:否。side passthrough 逐字转发、零注入,对这类调用严格比修复前更省缓存(此前会注入 tools/nudge);主轮前缀缓存语义不变。
  7. 是否改了设计方向:否。扩展既有 side-lane 机制家族(又一个结构形状谓词 + 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 passthrough),架构/边界/数据流不变。无 kernel 改动、无新依赖。
  8. 是否引入了新的配置:否。无新 env/config/默认值。

行为变更披露(旧→新):通知分类器请求从「主轮处理」(污染主会话 usage 基线/last model/snapshot/ledger/high-water)变为「#388 side passthrough」——逐字转发、不碰 kernel 状态、不注入 tools/nudge、不做输出预算恢复。这是本 PR 的目标修复;显式 agent=main 优先级不变,普通 Haiku 轮不受影响。

Review supplement:已推独立标注 commit ff9f955(见上一条评论)——把 issue 列的第四个症状(lastModel 被替换)从「结构性保证」升级为显式断言。

判定:可合并。 修复打到根因(在 lane 决策点阻止侧调进主管道,而非事后擦污染痕迹),方案与 issue 预期一致,测试双向齐全(正/负矩阵 + 三条 e2e 车道 + 缺口文档化测试),diff 干净(4 文件 +417/-10,每行都与本 PR 目的相关)。请 owner 合并:#4843

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

Merge conflict resolved and pushed.

The PR branch 2026-10-26_claude-notification-side-lane was ~1814 commits behind master and in a dirty (merge-conflict) state. I merged master (33104b1f) into the PR head (ff9f9550) and resolved all conflicts.

Conflicted files (3) — all resolved by keeping BOTH sides' logic:

tests/issue4840-claude-notification-side-lane.test.ts (the PR's new test) merged clean.

Verification (local, targeted — full suite is remote CI's job):

  • npm run typecheck → PASS (exit 0)
  • node --import tsx --test tests/side-lane-invariants.test.ts tests/issue4840-claude-notification-side-lane.test.ts tests/side-request-isolation.test.ts → 58/58 pass
  • Pushed fast-forward (no force): ff9f9550..b254fa58
  • PR now: mergeable: true, mergeable_state: behind (was dirty); head b254fa58, base 33104b1f. The behind is GitHub's transient recompute state — the branch now contains master's head, so it settles to clean.

结构化八问

  1. 是什么问题:PR 分支落后 master 约 1814 个提交,与 base 产生合并冲突(mergeable_state: dirty),无法合并。
  2. 什么原因导致的:PR 分支(2026-10-26 切出)期间,master 合入了 [Bug] 0.1.209: Claude Code CLI main conversation forks onto <id>|sub:<fp>; the session-title call claims the raw key (regression from #4774) #5135(claude-code title sidecar)、DSH: If the first request of a session originates from a bypass call, compression for the entire session is permanently | DSH: If the first request of a session originates from a bypass call, compress for the entire session is permanently inv | DSH:会话首个… #5656(dsh single-shot sidecar)等新增 side-lane 谓词,与本 PR 的 [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840(Claude Desktop 通知分类器 sidecar)在 handle.ts / side-request.ts / side-lane-invariants.test.ts 三处的同一区域叠加,产生文本冲突。
  3. 影响范围与严重程度:仅影响本 PR 的合并能力——冲突未解决前 PR 无法 merge。不影响任何已发布行为(master 侧代码原样保留,PR 侧 [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 逻辑完整保留)。
  4. 怎么修复的:用 merge(非 rebase,避免 force-push 且符合仓库冲突解决惯例)把 master 并入 PR 分支,逐块合并冲突——保留双方全部谓词与接线,不丢任何一方逻辑;sideLabel 三元链按 master 既有顺序追加 PR 的标签。
  5. 是否有回归问题:无。master 侧既有行为([Bug] 0.1.209: Claude Code CLI main conversation forks onto <id>|sub:<fp>; the session-title call claims the raw key (regression from #4774) #5135/DSH: If the first request of a session originates from a bypass call, compression for the entire session is permanently | DSH: If the first request of a session originates from a bypass call, compress for the entire session is permanently inv | DSH:会话首个… #5656 谓词、sideLabel 链、sideIntent 集合)逐条保留;PR 侧 [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 的四个消费点(persona keying、sideRequestLike、restoreOutputBudget 守卫、sideIntent/sideLabel)全部在位。typecheck 通过,定向 side-lane 测试 58/58 绿。
  6. 是否破坏缓存:不涉及。纯冲突合并,未触碰缓存/重试/游标/去重键逻辑。
  7. 是否改了设计方向:不涉及。未改架构/边界/数据流,仅合并两侧已有的 side-lane 谓词。
  8. 是否引入了新的配置:不涉及。无新 env/config/默认值。

判定:冲突已全部解决并推送,PR 恢复可合并(mergeable: true)。等待 CI 在新 head 上跑完整回归;CI 绿后即可由 owner 合并。

…2nd pass)

Master advanced 33104b1..e5e1647 (270 commits) since the first merge
(b254fa5). Reconciled the same side-lane surface:
- handle.ts import line: added isClaudeNotificationRequest (#4840) alongside
  master's hasSingleShotBudget + isStructuredOutputCall.
- restoreOutputBudget guard: combined !structuredOutputUtility (master #5073)
  with !claudeNotificationSidecar (#4840).
- sideLabel ternary: kept master's structured-output clause + appended the
  claude-notification clause.
- side-lane-invariants.test.ts: combined (G) comment + allowlist (added
  isClaudeNotificationRequest to master's set).
side-request.ts auto-merged clean. typecheck pass; targeted side-lane tests 64/64.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

2nd merge-conflict pass resolved and pushed.

Master advanced 33104b1f → e5e1647ba0 (270 commits) after the first merge (b254fa58), which re-dirtied the PR. I merged the new master into the PR branch and reconciled the same side-lane surface:

Verification: npm run typecheck PASS; targeted side-lane tests 64/64 pass. Committed merge 2d8004b194 (parents b254fa58 + e5e1647ba0) and pushed fast-forward (no force). Live PR state now mergeable: true (was dirty); CI static gates green, 10 test shards in progress, 0 failed.


结构化八问

  1. 是什么问题:PR [PR] fix: route Claude Desktop notification classifier through the side passthrough (#4840) #4843(Claude Desktop 通知分类器走 side passthrough)与 master 再次冲突。第一次合并(b254fa58,合入 master 33104b1f)后,master 又前进了 270 个提交到 e5e1647ba0,PR 重新变 dirty。
  2. 什么原因导致的:master 在这 270 个提交里改了同一批 side-lane 文件(handle.ts 的 import 行、restoreOutputBudget guard、sideLabel ternary,以及 side-lane-invariants.test.ts 的 (G) 注释与 allowlist),与 PR 的改动落在同一行/同一区域,产生文本冲突。
  3. 影响范围与严重程度:仅 PR 分支的合并冲突,不影响任何已发布行为;不解决则 PR 无法合并。
  4. 怎么修复的:用 MERGE(非 rebase)把新 master 合入 PR 分支,逐块保留双方逻辑——PR 的 isClaudeNotificationRequest/claudeNotificationSidecar 与 master 新增的 hasSingleShotBudget/isStructuredOutputCall/structuredOutputUtility 全部并集保留,不丢任何一方的语义。
  5. 是否有回归问题:无。typecheck PASS;定向 side-lane 测试 64/64 通过;restoreOutputBudget guard 与 sideLabel ternary 的并集同时保留了 master 的 Hermes lane: proxy adds ACP tools to toolless structured-output requests from child processes, which strict backends reject (400) #5073 语义与 PR 的 [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 语义,未改变任何既有判定。
  6. 是否破坏缓存:不涉及——纯 side-lane 判定与标签,不触碰缓存/重试/增量游标。
  7. 是否改了设计方向:不涉及——只是把 PR 的 side-lane 改动与 master 的演进对齐,无架构/数据流转向。
  8. 是否引入了新的配置:不涉及——无新 env/config/默认值。

判定:冲突已解决,PR 现 mergeable: true(mergeable_state: blocked 是分支保护的评审/CI 门禁,属正常等待态);CI 静态门禁全绿、0 失败,可进入正常评审/CI 流程。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

…3rd pass)

Union resolutions on the two hot-file conflicts:
- src/server/handle.ts: side-request.js import line gains BOTH isAudioOutputCall
  (#6636, master) and isClaudeNotificationRequest (#4840, this PR); the
  restoreOutputBudget skip gains both !audioOutputUtility and
  !claudeNotificationSidecar; the sideLabel ternary gains both the
  audio-output (#6636) and claude-notification (#4840) arms.
- tests/side-lane-invariants.test.ts: boundary comment gains both the #6636
  and #4840 predicate paragraphs; the handle.ts import allowlist gains
  isAudioOutputCall, isResponsesServerToolSingleShot and
  isClaudeNotificationRequest.

No semantic overlap: the two predicates are independent shapes (toolless
top-level audio object vs fixed Claude notification system + four ordered
labels), so the union keeps each side's behavior exactly.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 — this is the continuation of this PR's own conflict-resolution lane (3rd pass); no new issue/PR opened.

What I did this run (conflict resolution, 3rd pass):

The PR head (2026-10-26_claude-notification-side-lane) was 331 commits behind master and reported mergeable_state: dirty. I merged origin/master into the branch head and resolved all 5 conflict hunks:

  1. src/server/handle.ts:73 — the side-request.js import line: master added isAudioOutputCall (OpenAI wire: ACP ref tags + leading system are injected into every /chat/completions, breaking non-conversational side calls (TTS 400 "messages[0] system role is not allowed for TTS model") #6636) + isResponsesServerToolSingleShot ([Bug] pi lane: in-process fetch patch claims pi-web-access's xAI search call and hard-400s it (no conversation identity) #6548); this PR added isClaudeNotificationRequest ([Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840) → union, alphabetical.
  2. src/server/handle.ts:2469 — the restoreOutputBudget skip condition: master added !audioOutputUtility, this PR added !claudeNotificationSidecar → union, both vetoes kept.
  3. src/server/handle.ts:2671 — the sideLabel ternary: master added the audio-output utility call (#6636) arm, this PR added the claude notification classifier sidecar (#4840) arm → union, both arms kept at their respective positions.
  4. tests/side-lane-invariants.test.ts:361 — boundary comment: union of the OpenAI wire: ACP ref tags + leading system are injected into every /chat/completions, breaking non-conversational side calls (TTS 400 "messages[0] system role is not allowed for TTS model") #6636 and [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 predicate paragraphs.
  5. tests/side-lane-invariants.test.ts:374 — the handle.ts import allowlist: union set (gains isAudioOutputCall, isResponsesServerToolSingleShot, isClaudeNotificationRequest).

No semantic overlap between the two sides — the predicates are independent shapes (toolless top-level audio object vs. fixed Claude notification system prefix + four ordered labels), so the union keeps each side's behavior exactly. The PR's other hunks (claudeNotificationSidecar definition, sideRequestLike clause, sideIntent clause) and src/server/side-request.ts auto-merged cleanly; I verified all five PR hunks are present in the merged tree.

Verification (targeted, per local-testing discipline):

  • npm run typecheck — clean on the merged tree.
  • node --import tsx --test tests/side-lane-invariants.test.ts tests/issue4840-claude-notification-side-lane.test.ts — 24/24 pass.
  • Full-suite verdict: remote CI on the pushed head (not run locally).

Push & state (verified live this run):

  • Pushed 2d8004b19..d554f6efd to 2026-10-26_claude-notification-side-lane (plain push; remote head unchanged at push time, no force-push needed).
  • GitHub live: mergeable: true, mergeable_state: blocked — conflict resolved; now waiting on the required checks for the new head (the mirror cache had not yet picked up the new sha at reply time).

八问 (structured summary):

  1. 是什么问题: PR 分支落后 master 331 个提交,两个热文件存在合并冲突(merge state dirty),PR 无法合并。
  2. 什么原因导致的: PR(10-26 开出)与 master 在同一时段各自扩展了 src/server/handle.ts 的 side-lane 接线(import 行、restoreOutputBudget skip、sideLabel 三元链)和 tests/side-lane-invariants.test.ts 的边界测试——master 加了 audio-output(OpenAI wire: ACP ref tags + leading system are injected into every /chat/completions, breaking non-conversational side calls (TTS 400 "messages[0] system role is not allowed for TTS model") #6636)与 Responses server-tool([Bug] pi lane: in-process fetch patch claims pi-web-access's xAI search call and hard-400s it (no conversation identity) #6548)谓词,PR 加了 Claude notification([Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840)谓词,两侧改了同一批行。
  3. 影响范围与严重程度: 仅 PR 分支(2 文件 5 个冲突块);master 与任何用户均不受影响;严重度 = PR 被阻塞无法合并,非运行时缺陷。
  4. 怎么修复的: 把 master 合入 PR 分支头,每个冲突按「并集」解决——两侧谓词是互不重叠的独立形状,同时保留即精确保持双方行为,无需语义仲裁。
  5. 是否有回归问题: 无。并集同时保留 master 的 OpenAI wire: ACP ref tags + leading system are injected into every /chat/completions, breaking non-conversational side calls (TTS 400 "messages[0] system role is not allowed for TTS model") #6636/[Bug] pi lane: in-process fetch patch claims pi-web-access's xAI search call and hard-400s it (no conversation identity) #6548 行为与 PR 的 [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 行为;typecheck 干净;两个定向 side-lane 套件 24/24 通过;无阈值/时序/输出格式漂移。
  6. 是否破坏缓存: 不涉及——只动了 side-lane 谓词接线,未触碰缓存/重试/游标/去重逻辑。
  7. 是否改了设计方向: 不涉及。
  8. 是否引入了新的配置: 不涉及。

判定: 冲突已解决,PR 现为 mergeable(待新 head d554f6e 的 CI 检查 + 审批)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

…4th pass)

Union resolution on the two side-lane conflicts introduced by master's
#6880 dsh purpose-signal work:
- src/server/handle.ts sideIntent line: keep master's
  isSideRequest(parsed, requestAgent, declaredPurpose) third-arg call AND
  append this PR's || claudeNotificationSidecar tail.
- src/server/handle.ts sideLabel ternary: keep master's leading
  declaredPurpose !== undefined ? 'declared purpose=... (#6880)' : arm AND
  keep this PR's trailing claudeNotificationSidecar ? 'claude notification
  classifier sidecar (#4840)' : arm.

No semantic overlap: declaredPurpose is the dsh host's purpose header
signal (#6880); the Claude Desktop notification classifier never declares a
dsh purpose, so the two arms are disjoint. src/server/side-request.ts
auto-merged cleanly (isSideRequest's new optional purpose arg + the PR's
isClaudeNotificationRequest coexist).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 — continuation of this PR's own conflict-resolution lane (4th pass); no new issue/PR opened.

What I did this run (conflict resolution, 4th pass):

Live state at run start: mergeable: null / unknown (GitHub recomputing) — and master had advanced 62 commits since my previous merge (912aa6729..0821a8154), which re-introduced conflicts in the same side-lane region. I merged origin/master into the branch head and resolved both conflict hunks, both in src/server/handle.ts:

  1. sideIntent line — master's [Design][dsh] Stop guessing dsh's auxiliary requests — the in-process plugin can declare each request's purpose explicitly #6880 (dsh purpose-signal) changed the call to isSideRequest(parsed, requestAgent, declaredPurpose) (new third arg); this PR appends || claudeNotificationSidecar at the tail. Union: kept master's 3-arg call AND the PR's tail clause.
  2. sideLabel ternary — master added a leading declaredPurpose !== undefined ? "declared purpose=… (#6880)" : arm; this PR's claudeNotificationSidecar ? "claude notification classifier sidecar (#4840)" : arm sits at the tail. Union: kept master's leading arm AND the PR's tail arm.

No semantic overlap: declaredPurpose is the dsh host's purpose-header signal (#6880); the Claude Desktop notification classifier never declares a dsh purpose, so the two arms are disjoint. src/server/side-request.ts auto-merged cleanly — isSideRequest's new optional purpose arg and the PR's isClaudeNotificationRequest coexist (verified signature + all five PR hunks intact in the merged tree).

Verification (targeted, per local-testing discipline):

Push & state (verified live this run):

  • Pushed d554f6efd..66fc95dee to 2026-10-26_claude-notification-side-lane (plain push; remote head unchanged at push time — no concurrent agent, no force-push).
  • GitHub live: mergeable: true, mergeable_state: blocked — conflict resolved; now waiting on the required checks for the new head (mirror cache had not yet picked up 66fc95dee at reply time).

八问 (structured summary):

  1. 是什么问题: 上一轮合并后 master 又前进了 62 个提交([Design][dsh] Stop guessing dsh's auxiliary requests — the in-process plugin can declare each request's purpose explicitly #6880 dsh purpose-signal 等),在 side-lane 接线区域再次与 PR 冲突,PR 重新变为不可合并。
  2. 什么原因导致的: master 的 [Design][dsh] Stop guessing dsh's auxiliary requests — the in-process plugin can declare each request's purpose explicitly #6880 改了 isSideRequest 的调用签名(新增 declaredPurpose 第三参)并在 sideLabel 三元链头部插入新分支,与 PR 在同一两行(sideIntent、sideLabel)各自扩展了 claudeNotificationSidecar 逻辑,文本冲突再次发生。
  3. 影响范围与严重程度: 仅 PR 分支(1 文件 2 个冲突块);master 与用户均不受影响;严重度 = PR 被阻塞,非运行时缺陷。
  4. 怎么修复的: 再次把 master 合入 PR 分支头,两处均按「并集」解决——master 的 declaredPurpose 参数/分支与 PR 的 claudeNotificationSidecar 子句互不重叠(前者是 dsh 宿主 purpose 头信号,后者是 Claude Desktop 通知分类器形状),同时保留即精确保持双方行为。
  5. 是否有回归问题: 无。typecheck 干净;48/48 定向测试通过(含 master 新增的 [Design][dsh] Stop guessing dsh's auxiliary requests — the in-process plugin can declare each request's purpose explicitly #6880 套件,确认 purpose-signal 功能未被破坏;PR 的 [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 回归套件全绿);无阈值/时序/输出格式漂移。
  6. 是否破坏缓存: 不涉及——只动了 side-lane 谓词接线。
  7. 是否改了设计方向: 不涉及。
  8. 是否引入了新的配置: 不涉及。

判定: 冲突已解决,PR 现为 mergeable(待新 head 66fc95d 的 CI 检查 + 审批)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 — 本 PR 自身缺陷修复;红 CI 为 master 继承性失败(#2929 探针),与 #4599 协调通道已有记录,未另开 issue。

Red CI fixed — inherited master failure, resolved by merging the ci-fixes sentinel. New head b78d27ca0, full CI pass running.

What I did this run:

  1. Re-verified live state first. Mirror check cache was 12h stale (fetched 2026-11-16T11:13Z, predating the failures), so I pulled the failing job logs directly from the GitHub API (single fetches, per policy). All 3 red jobs (test ubuntu-24/1, ubuntu-22/1, windows-22/1, run 43855560896) fail on the same single test: #2929: nudge + proxy-tool-round fold keeps re-request/next-turn byte-stable at tests/issue2929-codex-fold-double-miss.test.ts:232 — scenario miss: no ephemeral nudge in the pre-fold request (inputs[6]). Verified in 2 of the 3 logs directly (ubuntu-24 and windows-22); the ubuntu-22 job is the same shard-1, same file, and the failure is a deterministic assertion (CI runner: "failing WITHOUT auto-retry"). Suite totals: 4797 tests, 1 fail, 24 skipped.

  2. Proved it is inherited, not caused by this PR. Checked out pure master 0821a8154 in a scratch worktree and ran the test: identical failure, twice (deterministic). The PR's side-lane changes cannot touch this path: the Claude-notification shape (fixed system prefix + 4 labels) never matches a codex scenario, and the merged sideIntent call is byte-identical to master's 3-arg form. The breakage comes from master-side nudge churn in the 62 commits merged last run (the codex 命中率问题分析 #2929 probe is schedule-dependent; master's nudge changes moved where the ephemeral nudge lands, and the probe anchor was never recalibrated).

  3. Applied the sanctioned fix — merge the sentinel, don't re-fix in-branch. Per the CI-coordination policy, master-level fixes converge on ci-fixes. The sentinel already carries exactly this fix: 245ecb1a9 fix(test): recalibrate #2929 probe anchor to nudge positions {3,5,11,14} + 724741097 test(#2929): make fold probe schedule-independent + hermetic wire shape. Merged origin/ci-fixes into the PR branch — zero conflicts with the PR's changes (15 files, +713/−53, all master-side: codex 命中率问题分析 #2929 probe fix, [Bug] Inconsistent system prompt separator in Responses internal re-request breaks cache prefix | [Bug] Responses 内部重请求的系统提示分隔符不一致,破坏缓存前缀 #6922 responses-section joiner, [PR] feat: pi lane — show the injected nudge text verbatim in the terminal when debug is on #6151 nudge-debug, architecture docs).

  4. Verified locally on the merged head (targeted runs only; full suite is CI's job):

    • previously-failing tests/issue2929-codex-fold-double-miss.test.ts → pass
    • PR side-lane suites → 48/48 (side-lane-invariants 16, issue4840 8, issue6880 10, side-lane-truth-table 14)
    • merge-brought suites (nudge-debug + cache-friendly-proxy) → 14/14
    • npm run typecheck → clean
  5. Pushed. Pre-push fetch confirmed the remote head was untouched (no concurrent agent). The merge commit is the final head, so it carries no [ework:ci-held] marker — this push is the branch's one full CI pass. Live check after push: head b78d27ca0, mergeable: true, state blocked (checks running). One transparency note: my first push command landed on a same-named scratch ref (pr4843-rebase) instead of the PR branch — caught it immediately, pushed to 2026-10-26_claude-notification-side-lane with an explicit refspec, and deleted the stray branch. Also left the one-line coordination note on CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 as the policy requires.


八问(中文结论):

  1. 是什么问题:PR 的 3 个 test job 全红,但都是同一个测试 #2929: nudge + proxy-tool-round fold keeps re-request/next-turn byte-stable(tests/issue2929-codex-fold-double-miss.test.ts:232,断言 pre-fold 请求 inputs[6] 里应有 ephemeral nudge,实际没有)。
  2. 什么原因导致的:master 继承性失败,不是本 PR 引入。纯 master 0821a8154 本地两次复现同一断言失败(确定性,非 flaky);codex 命中率问题分析 #2929 探针是 schedule-dependent 的,上一轮并入的 62 个 master 提交里的 nudge 改动挪动了 ephemeral nudge 的落点,探针锚点没跟着重校。本 PR 的 side-lane 改动与 codex 场景形状完全不匹配,且 sideIntent 调用与 master 逐字一致,排除自身因果。
  3. 影响范围与严重程度:仅 CI 门禁层面——本 PR 无法合入(以及 master 自身该测试红);无用户可见行为变化,是测试探针校准问题,不是产品行为缺陷。严重程度:门禁阻塞,非功能缺陷。
  4. 怎么修复的:按 CI 总控政策(2026-10-24)不自己改 master 级失败——直接 merge 哨兵分支 origin/ci-fixes(其中已收敛该修复:245ecb1a9 重校探针锚点到 nudge positions {3,5,11,14} + 724741097 使探针 schedule-independent 且 wire 形状 hermetic)。merge 无冲突,merge commit b78d27ca0。
  5. 是否有回归问题:无。本 PR 自身改动在 merge 后逐字未变;merge 带入的全是 master 侧已收敛内容。本地验证:原失败测试转绿、PR side-lane 48/48、merge 带入的 nudge-debug + cache-friendly-proxy 14/14、typecheck 干净。高危模式逐项:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化(测试探针校准属测试面;[Bug] Inconsistent system prompt separator in Responses internal re-request breaks cache prefix | [Bug] Responses 内部重请求的系统提示分隔符不一致,破坏缓存前缀 #6922 responses-section joiner 是 master 自己的修复,方向是修 round-2 prefix fork)。
  6. 是否破坏缓存:否。本次操作未触碰任何缓存/重试/游标/去重逻辑;带入的 [Bug] Inconsistent system prompt separator in Responses internal re-request breaks cache prefix | [Bug] Responses 内部重请求的系统提示分隔符不一致,破坏缓存前缀 #6922 joiner 修复反而是消除 prefix fork(缓存正向),且属 master 既有变更。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:否。

判定:修复已推(final head b78d27ca0,无 ci-held 标记,唯一一次全量 CI 正在跑);mergeable: true,等 CI 转绿即可合入。若 CI 再红,按 #4599 流程处理。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

APPROVE — the #4840 fix is correct, well-tested, and clean. No kernel change, no config surface, no new dependency.

What I verified

Core fix (4 files). isClaudeNotificationRequest (src/server/side-request.ts) is a pure shape predicate: no-tools veto + the fixed classifier system prefix on any wire carrier (systemCarrierTexts reads top-level system / instructions / systemInstruction.parts / role:system entries) + exactly ONE non-system message whose content is plain text carrying the four ordered status labels (the dynamic (last N chars) count matched by regex, never hardcoded). A real main turn can never match: it carries a tools surface and multi-turn history, and never carries these classifier labels. It is wired into all four consumers in src/server/handle.ts — verbatim session keying (sideRequestLike), the restoreOutputBudget skip (its 3072 budget must not seed the high-water), sideIntent (routes to the #388 passthrough), and the sideLabel log label — with explicit agent=main vetoes at the caller. The merge passes correctly preserved every consumer alongside master's newer side-lane predicates (audioOutputUtility #6636, declaredPurpose #6880, isAudioOutputCall, isResponsesServerToolSingleShot).

Tests. 8 tests (5 unit + 3 e2e), all passing locally on head b78d27ca0. The unit matrix asserts both directions (positive: captured shape, text-block, multiple text blocks, tail 0/2000, role:system carrier; negative: null/non-object/empty, any tools, wrong system, history-bearing, two user messages, missing label, out-of-order labels, non-text block, empty content, real Haiku turn). The e2e lanes pin all four pollution symptoms (usage baseline 85K→12K not clobbered, snapshot/counter untouched, high-water not seeded from 3072, lastModel not replaced) plus the control (a normal Haiku turn with tools+history stays a main turn with injection) and the explicit-agent=main veto. The #1440 boundary allowlist in tests/side-lane-invariants.test.ts is correctly updated with the required category justification. Related suites green: side-lane-invariants + lane-decisions-matrix + side-request-isolation = 167/167.

CI. Green on head b78d27ca0 (38 success, 0 failure, 0 in_progress — confirmed via a single check-runs fetch; the mirror cache was stale at 00:03).

Note on the diff

The PR head carries two files from the ci-fixes merge (the CI-coordination response to inherited master red): reference/architecture.md (#6922 module-map line) and tests/issue2929-codex-fold-double-miss.test.ts (#2929 probe recalibration). Both are byte-identical to origin/ci-fixes and are not part of the #4840 contribution — they land on master independently via ci-fixes. The #4840 contribution is the 4 files above.

结构化八问

  1. 是什么问题:Claude Desktop Code 标签页的「通知分类器」——挂在主会话 id 下的一次性侧调(固定 system 句 + 单条四标签 user blob、无 tools、max_tokens=3072)——被 bili 当成主会话的正常主轮处理,污染了主会话状态。
  2. 什么原因导致的:既有侧调识别只有「输出预算 ≤200」与「显式 agent 意图」两类信号,外加 dsh / claude-code 的专属形状谓词。3072 超预算门、Claude Desktop 无专属形状谓词 → 分类器漏进完整管道,产生四处污染:usage 样本替换主基线(85,236→12,149)、Haiku 成为会话 last model、单条消息覆写持久化 snapshot+ledger、restoreOutputBudget 用 3072 播种 outputBudgetHighWater。
  3. 影响范围与严重程度:p1(数据丢失类)。触发条件:Claude Desktop Code 标签页流量经 bili 代理 + 通知分类器开火。后果:持久化快照被侧调单条消息覆写(重载丢消息),另有基于错误基线的 nudge / 输出钳制决策漂移。
  4. 怎么修复的:新增纯形状谓词 isClaudeNotificationRequest,接入既有 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 side passthrough 的四处(verbatim 会话键控、sideIntent 路由、restoreOutputBudget 跳过、日志标签)。走 [Bug][dsh] 0.1.204: auto-review side request collides with the main session → false native-compaction rebase → aux usage skips #453 clamp → permanent upstream 400 #4438 auto-review 纪律:形状自带客户端证据、不加 header 门、显式 agent=main 否决优先。
  5. 是否有回归问题:无。isSideRequest 未动(历史 reason 字符串有字节稳定控制测试钉住);主管道唯一改动是 restoreOutputBudget 守卫加一个析取项(仅形状命中时生效);persona-fork 各站点本就由 !sideRequestLike 门控,新析取项只对恰好命中该形状的请求生效;resolveSideLane 纯函数签名未变、标签为增量参数;audit: 全仓冗余审计与重构计划——server.ts 解体、客户端矩阵去重、死代码、AGENTS.md 模块图腐化 #1440 allowlist 按要求更新。高危模式逐项清:无阈值漂移(SIDE_REQUEST_MAX_TOKENS=200 未动)、无 fail-fast 变吞错、无输出格式变化、无缓存/重试/游标策略变化。过抑制方向([bug] #3177 的 DSH compress-surface 抑制在「agent 能看到 bili 工具」的 DSH 环境下误伤:nudge 与 compress 系统提示被永久关闭 #3401 类)有显式控制测试:普通 Haiku 轮(tools+历史)仍走主管道、注入照常。
  6. 是否破坏缓存:否。side passthrough 逐字转发、零注入,对这类调用严格比修复前更省缓存(此前会注入 tools/nudge);主轮前缀缓存语义不变。
  7. 是否改了设计方向:否。扩展既有 side-lane 机制家族(又一个结构形状谓词 + 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 passthrough),架构/边界/数据流不变。无 kernel 改动、无新依赖。
  8. 是否引入了新的配置:否。无新 env/config/默认值。

行为变更披露(旧→新):通知分类器请求从「主轮处理」(污染主会话 usage 基线 / last model / snapshot / ledger / high-water)变为「#388 side passthrough」——逐字转发、不碰 kernel 状态、不注入 tools/nudge、不做输出预算恢复。这是本 PR 的目标修复;显式 agent=main 优先级不变,普通 Haiku 轮不受影响。

判定:可合并。 PR 打到根因(在 lane 决策点阻止侧调进主管道,而非事后擦污染痕迹),测试双向齐全,diff 每行都与本 PR 目的相关(另两文件为 ci-fixes 继承,非本 PR 贡献)。请 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Review complete — APPROVE. Full review with the structured 8-question checklist is in the comment above. In short:

Verdict: 可合并 — ready for the owner to merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 — 本 PR 第 5 轮接冲突,同一 sideIntent 热行碰撞模式(前 3 轮已记录),无新 issue。

Merge conflict resolved (5th pass). Master advanced 60 commits; one conflict hunk, resolved as a clean union. New head 046d30b8d, full CI pass running.

What I did this run:

  1. Live state first. The local branch had been reset to a stale master commit by workspace provisioning (reflog: bare reset); the remote PR head was still b78d27ca0 — untouched since the last run, no concurrent agent. Reset local to the true PR head, then merged origin/master (1a8be5db3, 60 new commits).

  2. One conflict, same hot line as the previous three passes — the sideIntent line in src/server/handle.ts. Master's [PR] fix(pi): declare every pi dispatch as the session's main conversation turn #7077 (discussions/6884: "declare every pi dispatch as the session's main conversation turn") changed the isSideRequest call to pass declaredPiMainTurn ? "main" : requestAgent as the agent arg; this PR appends || claudeNotificationSidecar at the tail of the same line. Resolved as the union of both intents: master's pi-main-turn override on the call, the PR's claude arm at the tail. The two are independent shapes (a pi dispatch declaring purpose=conversation vs the Claude Desktop notification classifier sidecar) with no semantic overlap.

  3. Verified the resolution: no conflict markers left; declaredPiMainTurn defined at src/server/handle.ts:1274 (auto-merged from master); all four PR wiring sites intact (definition :1238, sideRequestLike :1312, restoreOutputBudget skip :2509, sideIntent :2704, sideLabel :2728).

  4. Local verification on the merged head (targeted runs; full suite is CI's job):

    • npm run typecheck → clean
    • PR side-lane suites → 49/49 (side-lane-invariants 16, issue4840 8, issue6880 10, side-lane-truth-table 15 — master added one truth-table row)
    • the two NEW master suites touching the same file → 13/13 (issue6884-pi-purpose-declaration 5, nonobject-conversation-body 8)
    • previously-fixed issue2929 → still green (1/1)
  5. Pushed with an explicit refspec to the PR branch (the local branch name changed due to re-provisioning, so a bare push would have created a stray branch — lesson from the last run applied). Transparency note: the first push attempt was rejected with a truncated error; the retry succeeded immediately, remote head was verified unchanged before and after, so no branch fight. The merge commit is the final head and carries no [ework:ci-held] marker — this push is the branch's one full CI pass. Live check after push: head 046d30b8d, mergeable: true, state blocked (checks running).


八问(中文结论):

  1. 是什么问题:PR 分支与 master 再次冲突(dirty)——master 推进 60 个提交,其中 [PR] fix(pi): declare every pi dispatch as the session's main conversation turn #7077(pi purpose declaration)与本 PR 的 side-lane 接线撞在同一条 sideIntent 语句上。
  2. 什么原因导致的:与前 3 轮同一热行碰撞模式——master 持续演化 isSideRequest 调用的参数([Design][dsh] Stop guessing dsh's auxiliary requests — the in-process plugin can declare each request's purpose explicitly #6880 加 declaredPurpose 第三参;本轮 [PR] fix(pi): declare every pi dispatch as the session's main conversation turn #7077 把 agent 参改成 declaredPiMainTurn ? "main" : requestAgent),而本 PR 在同一行尾部追加 || claudeNotificationSidecar;master 每推进一次,该行必文本冲突。
  3. 影响范围与严重程度:纯合并门禁——PR 无法合入;无用户可见行为变化(解法为 union,双方语义原样保留)。严重程度:门禁阻塞,非功能缺陷。
  4. 怎么修复的:merge origin/master,唯一冲突 hunk 按 union 解——保留 master 的 declaredPiMainTurn ? "main" : requestAgent 调用(pi 声明主轮次覆盖),PR 的 claudeNotificationSidecar 臂保留在行尾。两个形状独立(pi 主轮声明 vs Claude 通知分类器 sidecar),无语义重叠。
  5. 是否有回归问题:无。PR 自身改动 merge 后逐字未变(sideIntent 行获得 master 自己的 pi 覆盖,属 master 语义);PR 全部 4 处接线完整;typecheck 干净;PR 套件 49/49 + 两个新 master 套件 13/13 + 上轮修好的 issue2929 仍绿。高危模式逐项:无语义漂移、无 fail-fast 变吞错、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:否——未触碰任何缓存/重试/游标/去重逻辑。
  7. 是否改了设计方向:否。
  8. 是否引入了新的配置:否。

判定:冲突已解并推送(final head 046d30b8d,无 ci-held 标记,唯一一次全量 CI 正在跑);mergeable: true,等 CI 转绿即可合入。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

# Conflicts:
#	src/server/handle.ts
#	tests/side-lane-invariants.test.ts
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷

6th pass — merge-conflict resolved and pushed.

Master advanced 25 commits since the last pass (1a8be5db3b → 548e396022) and re-touched the same three side-lane hot files. I merged origin/master into the PR branch, resolved every conflict as a union (kept both master's #6884 wire-client sidecars AND this PR's claudeNotificationSidecar), verified locally, and pushed.

What master added this round (the #6884 wire-client auxiliary sidecar batch):

  • src/server/side-request.ts: 3 new predicates — isMcodeTitleRequest, isMcodeOneShotAuxRequest, isOpencodeTitleRequest (auto-merged, no conflict — different region from this PR's isClaudeNotificationRequest).
  • src/server/handle.ts: 6 new sidecar consts (grokAuxSidecar, mcodeTitleSidecar, mcodeOneShotSidecar, gooseSingleShotSidecar, codebuddyCompactionSidecar, opencodeTitleSidecar) wired into the sideRequestLike clause, sideIntent, and sideLabel ternary; plus a #2701 anthropic-threads decline block and a new hasNonEmptyHeader helper.
  • tests/side-lane-invariants.test.ts: the 3 new predicates added to the import allowlist Set, plus a new test (O) for [PR] fix(preflight): fold probes blocked by the local egress fuse #7009.

Conflicts resolved (4, all union):

  1. src/server/handle.ts:73 import — union of isClaudeNotificationRequest (this PR) + the 3 new 跨 agent 核查:「session id = 唯一会话身份」这条定律,谁满足谁违反(#6880 背景) #6884 predicates (master), kept alphabetical.
  2. src/server/handle.ts:2786 sideIntent — master's 跨 agent 核查:「session id = 唯一会话身份」这条定律,谁满足谁违反(#6880 背景) #6884 clause chain + this PR's || claudeNotificationSidecar at the tail.
  3. src/server/handle.ts:2812 sideLabel ternary — master's 6 跨 agent 核查:「session id = 唯一会话身份」这条定律,谁满足谁违反(#6880 背景) #6884 arms + this PR's claudeNotificationSidecar ? "claude notification classifier sidecar (#4840)" arm before undefined.
  4. tests/side-lane-invariants.test.ts:375 allowlist Set — union of isClaudeNotificationRequest + the 3 new 跨 agent 核查:「session id = 唯一会话身份」这条定律,谁满足谁违反(#6880 背景) #6884 predicates.

The sideRequestLike clause and the restoreOutputBudget skip guard auto-merged cleanly (master's #6884 clauses and this PR's claudeNotificationSidecar landed in different positions).

Verification (this run):

CI on the new head f66708717d is pending (just pushed; the mirror cache hasn't populated it yet — I'm not asserting green from memory).


八问:

  1. 是什么问题: 上游 PR [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 分支与 master 再次冲突(第 6 次)。master 前进了 25 个提交,又改了同一批 side-lane 热文件,把本 PR 的 claudeNotificationSidecar 接线处盖住了。
  2. 什么原因导致的: master 的 跨 agent 核查:「session id = 唯一会话身份」这条定律,谁满足谁违反(#6880 背景) #6884 wire-client 辅助 sidecar 批次(grok/mcode/goose/codebuddy/opencode 六个 sidecar)与本 PR 的 claude-notification sidecar 都往 handle.ts 的同一批热行(import / sideIntent / sideLabel)和 side-lane-invariants.test.ts 的 import 白名单 Set 里插东西,两边改了同一行 → 文本冲突。这是热文件并发改动的固有冲突,不是本 PR 的逻辑问题。
  3. 影响范围与严重程度: 仅本 PR 分支的合并状态(dirty → clean),不涉及任何运行时行为;只有冲突解法错误才会影响 side-lane 路由,本次按 union 保留双方,行为不变。
  4. 怎么修复的: 把 origin/master merge 进 PR 分支,4 处冲突全部按 union 解(同时保留 master 的 跨 agent 核查:「session id = 唯一会话身份」这条定律,谁满足谁违反(#6880 背景) #6884 六个 sidecar 子句 和 本 PR 的 claudeNotificationSidecar);其余文件(side-request.ts 三个新谓词、sideRequestLike 尾子句、restoreOutputBudget 守卫、[PR] fix(preflight): fold probes blocked by the local egress fuse #7009 新测试)由 git 自动合并。
  5. 是否有回归问题: 无。typecheck 绿 + 136/136 定向 side-lane 测试过(含 master 新增的 [PR] fix(preflight): fold probes blocked by the local egress fuse #7009 测试 O 和本 PR 的 [Bug][Claude Desktop/MCP] Notification classifier is treated as the main request, overwriting the main conversation's us | [Bug][Claude Desktop/MCP] 通知分类器被当作主请求,覆盖主会话 usage/snapshot #4840 测试)。union 只增不改,既有 side-lane 路由语义(各 sidecar 判定、sideLabel 文案、restoreOutputBudget 跳过)逐条核对保持。
  6. 是否破坏缓存: 不涉及。纯 side-lane 路由接线,不碰缓存/重试/增量游标/去重键。
  7. 是否改了设计方向: 不涉及。只是把 master 已合入的 跨 agent 核查:「session id = 唯一会话身份」这条定律,谁满足谁违反(#6880 背景) #6884 sidecar 批次与本 PR 的 claude-notification sidecar 在热行上取并集,无架构/边界/数据流转向。
  8. 是否引入了新的配置: 不涉及。无新 env/config/默认值。

判定: 冲突已解、已推(f66708717d),本地 typecheck + 定向测试绿;等 CI 全量过即可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b) Re-review at head f66708717 — APPROVE.

The head moved from b78d27ca0 → f66708717 (another merge pass onto a newer master, 548e396022). The PR's actual contribution (master..head) is the same clean 4-file set — the 2 files that appeared in the previous head (reference/architecture.md #6922, tests/issue2929-...test.ts #2929) are now in master, so they no longer show in the diff. The #4840 code is byte-for-byte the same predicate + 4 consumers I reviewed before; the only drift is handle.ts +1 line (a comment line). Re-verified end-to-end at the new head:

Verification at f66708717: CI green (38 success / 0 failure / 14 skipped / 0 pending — one-time check-runs fetch; mirror cache was stale). Targeted tests locally: 8/8 #4840 + 168/168 related side-lane suites (side-lane-invariants + lane-decisions-matrix + side-request-isolation) pass. No kernel change, no config surface, no new dependency → no authorization gate, no small findings to fix on the spot.


8 问(结构化 review,中文):

  1. 是什么问题:Claude Desktop 的 Code-tab 通知分类器在主会话 id 下发一个一次性 side 调用(固定 system 句 + 一条带四个有序标签的 user blob、无 tools、max_tokens=3072)。修复前它走了完整主轮管线,污染主轮状态。
  2. 什么原因导致的:这个分类器调用的 3072 预算超过了 <=200 的 single-shot 门槛,且没有 tools(不像 title/review sidecar),所以既有的所有 side 信号都看不见它,被当成主轮处理。
  3. 影响范围与严重程度:仅影响跑了 Claude Desktop Code-tab 通知分类器的会话——分类器的 usage 样本替换主轮基线、Haiku 变成会话 last model、单消息 payload 覆盖持久化快照+账本。属数据污染(缓存/存储泄露类),但只在特定客户端(Claude Desktop)触发。
  4. 怎么修复的:按形状识别([Bug][dsh] 0.1.204: auto-review side request collides with the main session → false native-compaction rebase → aux usage skips #453 clamp → permanent upstream 400 #4438 纪律)——无 tools 否决 + 固定分类器 system 前缀(任意 wire 的 system carrier)+ 恰好一条纯文本 user 消息带四个有序标签(Current state / Tool calls so far / User's most recent ask / Assistant message tail (last N chars),N 动态用正则,不硬编码)。识别后走 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 side passthrough:verbatim keying、跳过 restoreOutputBudget 高水位、sideIntent、sideLabel。真实主轮永不匹配(带 tools + 多轮历史 + 从不带这些标签)。
  5. 是否有回归问题:无。纯 shape 谓词,无阈值/无会话状态;四个消费者都并列保留 master 上更新的 side 谓词;audit: 全仓冗余审计与重构计划——server.ts 解体、客户端矩阵去重、死代码、AGENTS.md 模块图腐化 #1440 边界 allowlist 同步加了 isClaudeNotificationRequest。
  6. 是否破坏缓存:不破坏——修复正是为了让分类器不再污染高水位/快照/账本;主轮路径字节不变。
  7. 是否改了设计方向:否。沿用既有 标题生成等侧请求污染主会话状态:prepareAnthropic 缺 isTitleGen 守卫、快照无条件覆盖、survivedCount 每请求空转 #388 side passthrough 机制,只是新增一个 shape 谓词接入四个消费者。
  8. 是否引入了新的配置:否。无新 env/config/默认值。

行为变更披露(旧值→新值):分类器调用从「主轮处理」→「#388 side passthrough」;旧行为污染 usage 基线 / lastModel / 快照 / 账本 / 高水位,新行为 verbatim 转发、不碰任何主轮状态。

判定:可合并 — ready for the owner to merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Re-review complete at head f66708717 — APPROVE / 可合并. (Full 8-question review is in the comment above.)

The head moved from b78d27ca0 via another merge pass onto a newer master (548e396022); the #4840 contribution is byte-identical (same 4 files, same predicate + 4 consumers). CI green (38 success / 0 failure / 14 skipped), targeted tests 8/8 #4840 + 168/168 related side-lane suites pass locally. No kernel change, no config surface, no new dependency. Ready for the owner to merge.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

This branch has not been deployed

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

Labels

bug Something isn't working claude p1 scope/wiring

Projects

None yet

1 participant