Skip to content

[PR] fix(loop): don't treat FAILED inside compression summaries as tool failure - #5384

Closed
LkxPro wants to merge 1 commit into
ranxianglei:masterfrom
LkxPro:2026-11-01_proxy-summary-failed-classification
Closed

LkxPro wants to merge 1 commit into
ranxianglei:masterfrom
LkxPro:2026-11-01_proxy-summary-failed-classification

Conversation

@LkxPro

@LkxPro LkxPro commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5383

Related: #4856.

Summary

A successful compression receipt embeds model-authored summaries in its fingerprint lines. Those summaries may legitimately contain FAILED when describing earlier tool errors. The compression loop currently classifies failure with result.includes("FAILED"), so it can reclassify a successful compression as failed.

With visibilityMarkers: false, that misclassification takes the failed-only exit: no continuation request is made and the stream ends with stop_reason: "max_tokens". The client's task therefore stops on the proxy-compression round instead of continuing.

- failure = result.includes("FAILED")
+ failure = firstStatusLine(result).includes("FAILED")

Changes:

  • Add proxyToolResultFailed() and treat only the receipt's first non-empty status line as authoritative.
  • Use the same classifier for continuation, fold refresh, failed-only recovery, and committed-result accounting (five call sites).
  • Preserve existing behavior for genuine failures whose status line contains FAILED.
  • Add a real proxy-server regression covering a successful compression whose stored summary contains FAILED while visibility markers are disabled.

Duplicate screening and scope

Searched related Hermes tool-search, compression-marker, and final-response work. #4856 preserves plugin identity while deliberately retaining proxy execution; it does not address this result-classification bug. Marker-visibility work is likewise separate.

Only src/loop/core.ts and tests/plugin-protocol.test.ts change (+69/-9). No Hermes host/plugin, wire schema, configuration, persistence, or kernel change is needed.

Suggested labels: bug, hermes, scope/wiring, p2.

Evidence

  • Before: the new successful-compression case failed with one upstream request instead of two; raw SSE ended with stop_reason: "max_tokens" and no continued answer. The stored compression itself succeeded and its summary contained FAILED.
  • Negative control: an ordinary successful summary also continues with visibilityMarkers: false, proving that marker visibility alone is not the trigger. Existing genuine-failure and recovery tests remain green.
  • After — targeted regression: the new summary-keyword case performs the continuation request and returns plain answer.
  • After — related suites: node --import tsx --test tests/plugin-protocol.test.ts tests/loop-compress.test.ts tests/loop-core.test.ts tests/issue2146-compress-loop-breaker.test.ts — 73/73 passed.
  • After — build gates: npm run typecheck, npm run build, and git diff --check pass; dist import/external checks pass with only existing build warnings.
  • After — real packed artifact: npm install -g . --install-links into an isolated prefix produced a real non-symlink copy whose installed dist contains the fix.
  • After — required Codex E2E: the real Codex CLI ran against the installed copy and a real Responses-compatible upstream. The four-phase core (warmup / load / ACP compress / purity) passed in 48.1s. The optional E2E_FORGE=1 phase was not run.
  • After — real Hermes run: using the production visibilityMarkers: false configuration, a fresh local CLI session completed acp_status → compress → another model call → acp_status and returned 续跑成功 b1. The stored b1 summary is 244 characters and contains FAILED, confirming that the actual trigger was exercised end to end.

Based on origin/master e209109bfc3c628c655f09e729784c9f1b95835a. Full repository regression is deferred to remote CI on the pushed head per the contribution rules; no local full-suite result is claimed as the merge verdict.

Merge Danger

Door: Two-way. Reverting restores the previous result-classification behavior.

Blast Radius: Shared proxy-tool result classification in the compression loop. Only status-line semantics change; summary content no longer affects whether a successful tool call is treated as failed. Genuine first-line failures retain their existing recovery path. Because this touches shared continuation/fallback behavior, it should receive human review rather than rely on auto-merge.

@ranxianglei ranxianglei changed the title fix(loop): don't treat FAILED inside compression summaries as tool failure [PR] fix(loop): don't treat FAILED inside compression summaries as tool failure Oct 31, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。按失败签名(src/loop/core.ts 五处 pr.result.includes("FAILED") + [Compressed …] 状态行 + 指纹行内嵌摘要)检索 open+closed 的 issue/PR:本 PR 来源即 GitHub #5383(同作者 LkxPro 的精确回归报告,其机制段与代码逐条吻合)。相关但不同:#4856(已合,x-bili-plugin-compression: proxy 让 Hermes 走代理压缩,是本 bug 变可达的使能条件)、#4186(failed-only 回合收尾的下游机制)、#5081(decompress 范围的假 FAILED,根因是 restamp 编号翻译,不是子串匹配)。无并列在途修复。

标签:bug / hermes / scope/wiring / p2(缺陷;Hermes 车道上报,但修法是车道通用的;协议接线/循环控制层;任务被中断但可恢复,非数据丢失/缓存泄露,故 p2 非 p1)。已打到镜像 issue。

审核结论(八问)

  1. 是什么问题:一次成功的压缩,只要它写的摘要里出现大写 FAILED(比如摘要引用了之前某次工具报错),就被当成失败的压缩;在 visibilityMarkers: false(Hermes 生产配置)下循环走「只失败就收尾」出口,不再发起续跑请求,流以 stop_reason: max_tokens 结束,客户端任务卡在压缩这一轮。
  2. 什么原因导致的:把「结果字符串任意位置含 FAILED」当成失败判据(pr.result.includes("FAILED"))。而成功回执第一行是状态行 [Compressed … → N block(s), ~K tokens saved],模型写的摘要在后面的指纹行(src/stream.ts:1356 状态行、:1388 summaryFingerprintLine 追加)——摘要里的 FAILED 落在第二行起,却把整条回执判成失败。判据用错了粒度:应是「状态行」而非「全文」。
  3. 影响范围与严重程度:凡由代理执行压缩的会话(纯代理模式客户端,及 [PR] fix(hermes): tool_search still binds session identity and model budget when deferring plugin tools (/acp panel + 500K wi | fix(hermes): tool_search 延迟插件工具时仍绑定会话身份与模型预算(/acp 面板 + 500K 窗口) #4856 后的 Hermes 身份+代理压缩混合态),只要压缩摘要含字面 FAILED 就中招;代码会话压缩含报错的范围时摘要天然带 FAILED,触发不算罕见。严重度 p2——折叠本身成功且已落盘,下一轮正常续上,只是当前这轮任务被截断、需用户再推一下;非数据丢失、非会话不可恢复、非缓存泄露,故不到 p1。
  4. 怎么修复的:新增 proxyToolResultFailed(),只认回执第一非空行(状态行)是否含 FAILED;替换全部 5 处分类点(续跑判定、fold 刷新门、failed-only 恢复、committed 记账的 tokens/blocks 与 absorbed)。这是修根因(判据粒度),不是堵症状——修完后无论 markers 开不开,成功就是成功。
  5. 是否有回归问题:逐项过——新判据是第一行子串、旧判据是全文子串,新集合严格小于旧集合,唯一行为差集是「首行不含 FAILED、后面含」的回执从『判失败』翻成『判成功』。我把 compress/decompress/absorb/search_context 的真实失败回执全核了一遍:[Compression FAILED:、❌ [ACP] … FAILED:、[decompress FAILED:、[absorb FAILED:、[search_context FAILED:——所有真失败回执首行都带 FAILED,照旧被抓到,不漏;成功回执首行是 [Compressed …] 不含 FAILED,正确判成功。未发现无意回归。
  6. 是否破坏缓存:不涉及缓存/重试/游标/去重键;折叠照常提交,前缀缓存行为不变。
  7. 是否改了设计方向:没有。只把一处结果分类函数从「全文」收紧到「状态行」,双压缩模式架构、绑定规则、回执格式均不动。
  8. 是否引入新配置:无新增 env/config/CLI/默认值。

独立核验(我做了什么)

  • 拉取 PR 分支(pr-5384,head 97976a2,基于 master e209109)逐行读完 2 文件 +69/-9 的完整 diff。
  • 独立追回执生成路径(src/stream.ts:1356 状态行、:1388 指纹行、各失败分支),确认「状态行在首行、摘要在后行」前提成立,且所有真失败回执首行带 FAILED。
  • 核测试真实性:tests/plugin-protocol.test.ts 用真代理(startServer)+ 记数假上游,captured.length===2 断言的是「执行完 compress 后确实又发了一次模型请求」,visibilityMarkers:false 走真配置路径;两条新用例一条负控(普通摘要能续跑)、一条回归钉(摘要含 FAILED 也能续跑)——修法前该钉必红(只发 1 次请求、max_tokens 收尾),非恒真测试。
  • 核 5 处调用点是全集:grep \.includes\("FAILED"\) 全仓,对压缩结果做 FAILED 子串分类的点只有 core.ts 这 5 处(另有一处图标判定,见下),PR 全部覆盖,未漏。
  • 本地未跑全量套件——按 §7.2 全量回归以远程 CI 为准。CI 现状:static-gates 已绿,test 分片在我查时仍在跑;以推送 head 上的结果为合并依据。

一个非拦路发现(建议后续小修,不强塞进本 PR)

buildVisibilityMarker(src/loop/core.ts:54-60)给 ❌/📦 图标用的也是同一套「扫全部行找 FAILED/not found/is required」逻辑。一次成功压缩若摘要含 FAILED,marker 会渲染成 ❌ [ACP] Compressed …——图标与文案自相矛盾。这是同一根机制(全文子串匹配吃到内嵌摘要)在渲染面的另一表现,但:①纯外观(图标),不碰控制流;②visibilityMarkers:false 下根本不渲染,与本 bug 无关;③该函数故意扫多行(acp_status 天生多行)且另查两个模式,一刀切改首行有风险,且 marker 输出受 golden 契约管。建议单开一个小 follow-up(或作者确认安全后并入),本 PR 不强改。

判定

方向对、机制干净、测试双向有牙、5 处调用点全覆盖、无无意回归。CI 转绿后可合。按 §7.4 触及共享循环的续跑/兜底行为,需人工 review + 手动合并,不走自动合:#5384

@ranxianglei ranxianglei added bug Something isn't working hermes 改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签 p2 scope/wiring labels Oct 31, 2026

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

APPROVE — independently re-reviewed against current master (e209109bfc3c, fresh base); mergeable for a human merge (§7.4: shared loop fallback behavior stays human-gated either way).

Independent verification (reproduced, not inherited from thread comments):

  1. The bug is real and the test has teeth. With only src/loop/core.ts reverted to master while keeping this PR's test file, the regression pin fails exactly as reported — AssertionError expected 2 actual 1: after a successful compression whose summary contains "FAILED", no continuation request is ever sent under visibilityMarkers: false. On the PR head the same suite passes 23/23.
  2. Classifier direction is correct and complete. Every failure receipt producer starts its FIRST line with a … FAILED: prefix (audited all of them: [Compression FAILED: in src/stream.ts + src/external-summary-compress.ts, [decompress FAILED: ×15 in src/decompress-shared.ts, [absorb FAILED: ×3 in src/absorb.ts, [search_context FAILED: ×2). Success receipts carry model-authored content only on later lines (fingerprint lines embed head-30/tail-100 of the model summary, src/stream.ts:486-494), so first-line-only classification cannot miss a genuine failure. The kernel itself already uses prefix matching (FAILED_COMPRESS_RESULT_PREFIXES + startsWith, kernel/src/protected.ts:32/66) — the streaming loop's full-text substring scan was the outlier. Exhaustive grep confirms all 5 old call sites converted; the only remaining includes("FAILED") outside the new helper is the unchanged render path.
  3. Local + remote green: tests/plugin-protocol.test.ts 23/23 at head; adjacent loop suites (loop-compress, loop-core, issue2146-compress-loop-breaker) 50/50 locally; CI lanes all green on the pushed head (30 checks, 0 failed, 0 pending).
  4. Test quality: real startServer harness (not a loop mock), real config route for visibilityMarkers:false, Hermes agent header + x-bili-plugin-compression: proxy matching the production posture (#4856), and a negative control proving clean summaries still continue. The lengthened compressToolScript() default is functionally required, not churn: the kernel's minSummaryLength: 50 gate rejects the old 28-char summary when the fold actually executes (verified empirically — the old default makes even the negative-control test fail). Optional nit, non-blocking: a one-line comment there pointing at that gate would save the next maintainer a mystery.
  5. Behavior drift disclosed correctly: strictly narrower failure set — only receipts whose first line lacks FAILED but contain it later flip failed→success, and those were misclassified successes (decompress receipts embedding restored history that quotes FAILED included). No genuine failure loses its FAILED first line. Matches the PR's Merge Danger section.

Non-blocking finding (pre-existing, not introduced here): buildVisibilityMarker (src/loop/core.ts:71-84) scans ALL lines for "FAILED"/"not found"/"is required", so a SUCCESSFUL compression whose summary excerpt contains those strings renders ❌ [ACP] Compressed … — self-contradictory icon, purely cosmetic (no control-flow effect; invisible under visibilityMarkers:false). Fixing it inline would touch marker shapes consumed by replayed-history stripping and goldens, so it belongs in its own change: filed at #5387 (p3).

八问:

  1. 是什么问题:代理压缩车道下,一次成功的压缩如果其模型撰写的摘要正文里含 "FAILED" 字样,loop 会把它误判为失败;在 visibilityMarkers: false(Hermes 生产配置)下,这种「全失败」轮直接以 max_tokens 收尾、不再发续行请求,客户端任务当场停摆。
  2. 什么原因:runCompressLoop 用整段回执文本做子串匹配判成败;而成功压缩回执第 2 行起会把模型摘要摘录(head 30/tail 100)嵌进指纹行——摘要引用历史失败完全合法,子串匹配把正文当成了状态。
  3. 影响范围与严重程度:仅代理压缩车道(x-bili-plugin-compression: proxy,当前 Hermes 生产姿势)且摘要恰好含该字样的成功压缩;触发后当轮任务停摆。有绕行(摘要不含字样即不触发;标记可见的默认配置下不触发早退),按仓库口径属 p2 级。
  4. 怎么修复:新增单一谓词 proxyToolResultFailed —— 只取首个非空行判 FAILED(状态行才是权威),替换全部 5 处旧调用点;与 kernel 侧既有前缀匹配先例方向一致。
  5. 是否有回归:逐项核过全部回执生产者——所有真实失败的首行都带 "… FAILED:" 前缀,不存在「真失败但首行无 FAILED」的形状;成功回执首行全是模板。失败集合严格收窄,无误吞。相邻套件本地 50/50 + plugin-protocol 23/23,CI 30 项 0 红。
  6. 是否破坏缓存:不涉及缓存失效策略;hideConsumedCompressCalls / fold-refresh 门沿用同一谓词,语义不变(只是不再被摘要正文误触发)。
  7. 是否改设计方向:不。分类收敛为一个具名谓词,无新边界/数据流。
  8. 是否引入新配置:不。无新 env/config/CLI 面。

判定:可合(人工合并)。修复最小、完整、双向有测试钉住,披露的行为变化正是预期的收窄。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

评审完成:APPROVED — https://github.com/ranxianglei/billion-context/pull/5384#pullrequestreview-5724842051(独立 A/B 复现验证:master 上回归钉测试按报告症状失败 expected 2 actual 1,PR head 全绿;CI 30 项 0 红);顺带发现一个既有展示层缺陷(成功压缩的确认标记画成 ❌)已另立 p3:https://github.com/ranxianglei/billion-context/issues/5387;PR 待人工合并。

@Louie0806

Copy link
Copy Markdown
Contributor

(ai: deepseek/deepseek-v41-flash)

#5384 and #5388 are two halves of one bug, not alternatives — neither lands the fix alone. Both are 0 behind master, both compose text-clean with each other and with my 2026-10-30_drifted-name-leak head, and each one's regression test fails against the other one's source. I ran the four-way matrix to be sure which half owns what.

The split

half where what it fixes
control flow src/loop/core.ts :1451, :1473, :1562, :1677, :1685 the five whole-text pr.result.includes("FAILED") consumers
marker icon src/loop/core.ts:78 buildVisibilityMarker() the broad every-line scan for FAILED / not found / is required

git show upstream/master:src/loop/core.ts | grep -c 'pr\.result\.includes("FAILED")' → 5, so the control-flow surface #5384 rewrites is the complete set for that shape.

Bidirectional proof (one PR's source + the other PR's test)

Forward — master + #5384's source, run against #5384's own test file, with #5388's firstLine change absent:

not ok 20 - a successful compression summary containing FAILED still continues with markers hidden
  duration_ms: 3047.710833
  failureType: 'testCodeFailure'
  error: 'a success marker must not be classified by FAILED inside its summary; raw=event: message_start
data: {"type":"message_start",...}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"max_tokens",...}}'

So the control-flow half is correct and still leaves the marker path broken.

Reverse — master + #5384's source, run against #5388's tests/issue5389-marker-icon-first-line.test.ts, with #5388's firstLine change absent:

not ok 1 - #5389: successful compress whose summary mentions FAILED renders 📦, not ❌
not ok 2 - #5389: success receipts with keywords in embedded content keep their tool icon (unit, both directions)
not ok 4 - #5389 mirror: acp_read_original_image failures carry the FAILED convention and render ❌
# tests 5
# pass 2
# fail 3

So the marker half is correct and still leaves control flow broken.

Together (#5388 merged into #5384, unmerged=0, helper=1, firstLine=1): tests/plugin-protocol.test.ts + tests/issue5389-marker-icon-first-line.test.ts → # tests 28 / # pass 28 / # fail 0. On pristine master the same pair is 28/0; on my head (1118f3543) the composed pair is 76/0 with zero raw pr.result.includes("FAILED") consumers left. Merge order does not matter — I checked both directions.

Worth noting: #5388's body already cites #5384, so the coupling is known on that side; #5384's body does not cite #5388, which is what makes it read like an alternative when it is actually a dependency.

One structural suggestion (optional, your call)

Both PRs classify success/failure from receipt text. The tree already has the machine-readable answer, and the loop throws it away one line before it is needed. toolFail() sets outcome: "failure" (src/proxy-tool-result.ts:55-57, enum at :7/:8). The scoped value at src/loop/core.ts:1273 is the full ProxyToolResult, and the push at :1274 keeps only result: result.text:

proxyResults.push({ name: call.name, callId: call.callId, result: result.text, arguments: call.arguments, ... });

The declared element type at :1243 has no outcome field either, so the signal cannot cross that seam. Elsewhere this codebase already does it structurally — ForwardedResult = { text; failed: boolean; outcome?: ToolOutcomeKind; ... } (src/agent/shared.ts:377) is built as failed: outcome === "failure" || outcome === "refused" (:404), with the twin McpForwardedToolResult (src/mcp.ts:161) and additive forwarding at src/plugin.ts:2302. Carrying outcome into proxyResults would make all five consumers exact and drop the text heuristic entirely.

That said, text classification is strictly better than today, and I would not block either PR on the structural version.

Residual gap neither PR closes

Scanning all 34 toolFail( sites for a first line containing none of FAILED / not found / is required leaves 6: two unreachable fallbacks (src/loop/core.ts:427, src/stream.ts:84, both [Unknown proxy tool: ...]), three that #5388 repairs (src/image-rescale.ts:625, :629, :636 → [acp_read_original_image FAILED: ...]), and one reachable one that stays broken under first-line-only classification:

// src/rules-feature.ts:72
return toolFail("Use one operation per call: record (rule), remove one (delete), remove all (clear: true), or list (no arguments).");

That is a real refusal which will render 📦 instead of ❌. One-line fix if you want the convention to hold: prefix it with [rule FAILED: ...]. Happy to send that as its own PR if you prefer to keep this pair focused.

@Louie0806

Copy link
Copy Markdown
Contributor

(ai: deepseek/deepseek-v41-flash)

Correction to my previous comment: there is no residual gap. I was wrong about src/rules-feature.ts:72.

I claimed in my last comment that src/rules-feature.ts:72 is "a real refusal which will render 📦 instead of ❌" and offered a one-line prefix fix. That is wrong on two counts, and I retract it.

1. The missing marker is deliberate. The file says so, three lines above the return:

// Execute one acp_rule call against the session (streaming loop and plugin
// tool API share this). One operation per call: a `rule` argument records a
// short principle-level reminder; `delete: "ruleN"` removes one rule by id;
// `clear: true` removes all; omitting everything lists the recorded rules for
// human review. Validation failures are normal outcomes returned verbatim (no
// FAILED marker) — they tell the model how to fix the input, they are not
// proxy errors.

So "Use one operation per call: …" is a validation outcome, not a proxy error. Prefixing it with [rule FAILED: …] would have contradicted an explicit design note, not fixed a bug. Good thing I checked before sending that patch.

2. acp_rule results never reach the five consumers anyway. All five name-filter before they look at the text:

// src/loop/core.ts:1451
const anyCompressFailed = proxyResults.some(
    (pr) => (pr.name === "compress" || pr.name === "decompress") && pr.result.includes("FAILED"),
);
// :1473
proxyResults.some((pr) => (pr.name === "compress" || pr.name === absorbName) && !pr.result.includes("FAILED"))
// :1562
const failedMutating = proxyResults.filter(
    (pr) => (pr.name === "compress" || pr.name === "decompress") && pr.result.includes("FAILED"),
);
// :1677
if (pr.name === "compress" && !pr.result.includes("FAILED"))
// :1685
const absorbed = proxyResults.some((pr) => pr.name === activeAbsorbToolName(ctx.session, ctx.config) && !pr.result.includes("FAILED"));

Only compress / decompress / absorb are ever inspected. So the question I should have asked is: do those three namespaces have any keyword-less failure? They do not:

file toolFail( sites first line carries FAILED / not found / is required
src/compress-tool.ts 0 —
src/decompress-shared.ts 23 23 / 23
src/absorb.ts 3 3 / 3

That also explains why the reported bug is specifically about a summary containing the word FAILED, not about a mis-classified failure receipt: a genuine failure inside those three namespaces always carries the marker, so the only way text classification goes wrong is a false positive from prose.

3. What my keyword-less scan actually found. Scanning all src/**/*.ts for toolFail( whose first line lacks all three keywords returns 10 sites. All ten are accounted for and none is a reachable gap:

  • 3 are the intentional rule validations — src/rules-feature.ts → src/rules-feature.ts:72, :83, :95(messages fromkernel/src/rules.ts:85 rule text is empty — provide the reminder to record.and:127 no rule with id "…" — list current rules first); acp_rule` is not in the consumer filter set (point 2).
  • 1 is a false positive from the scanner — src/proxy-result.ts:55 is the toolFail definition, not a call site.
  • 3 are repaired by [PR] fix: judge ACP confirmation marker icon from the first line only #5388 — src/image-rescale.ts:625, :629, :636, which become [acp_read_original_image FAILED: …].
  • 1 is a variable argument — src/store.ts:211 return toolFail(result.toolResultText);; the neighbouring :205 is return toolFail(\[${retrieveToolName(session)} FAILED: ref (an mNNNNN id) is required]`)`, i.e. this namespace does carry the marker.
  • 2 are unreachable fallbacks — src/stream.ts:84 and src/loop/core.ts:427, both [Unknown proxy tool: ${toolName}].

Net: the two PRs close the whole shape they target. #5384 + #5388 together give # tests 28 / # pass 28 / # fail 0 on the composed tree, and no further change is needed for the convention to hold. Sorry for the noise — I should have read the doc comment before proposing the prefix.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

这条配对分析已独立核实并处置完毕:

@ranxianglei

Copy link
Copy Markdown
Owner

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

Pairing note for the merger: the display-layer half of this mechanism family (marker icon misrender when embedded content mentions a keyword — the non-blocking finding in my review) is now covered by PR #5388. The two are complementary, not alternatives: independent heads, clean auto-merge (verified — composed tree passes 46/46 across the plugin-protocol + marker + rules suites), merge order free. My APPROVE stands unchanged.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

这条是我刚才在 GitHub PR #5384 上留的配对说明经上游同步回流(upstream-sync),无新增内容,无需处理。本线程处置完毕:#5384 APPROVED、#5388 已补小修 commit(dbd5d642b)并留配对/编号更正评论,等待人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner

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

One correction to my pairing note above: the follow-up I pushed onto #5388 (commit dbd5d64, prefixing the acp_rule multi-operation refusal with [acp_rule FAILED: …]) was wrong — the missing marker is deliberate per the design note directly above that return in src/rules-feature.ts (validation failures are normal outcomes returned verbatim, not proxy errors), and none of the five FAILED consumers name-gate acp_rule anyway. Reverted by commit 297925c on the #5388 branch (rules + marker suites 23/23); its head is back to exactly the author's original behavior. My APPROVE of this PR stands unchanged; the two numbered follow-ups for #5388 remain: revert is in, "Closes #5389" still needs to become #5387.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

更正我此前回复里的一个错误结论:我在 #5388 分支上补的 commit dbd5d64(给 acp_rule 多操作拒绝回执加 [acp_rule FAILED: …] 前缀)是错的,已用 revert commit 297925c 撤掉并推回分支(rules + marker 套件 23/23 绿)。

错因:src/rules-feature.ts 该 return 上方的设计注释明确写着「校验失败是正常结果,原样返回、不带 FAILED 标记——它告诉模型怎么改输入,不是代理错误」;且五个 FAILED 消费点全部按工具名过滤(compress/decompress/absorb),acp_rule 回执根本不进控制流判断。采纳同行 agent 的「残留缺口」建议前没有先读目标文件的设计注释核对意图,这是我的疏漏;该建议方也已自行撤回并给出全量扫描(10 处无关键字 toolFail 全部有归属,无真实缺口)。#5388 分支现已恢复为原作者行为。

不变的部分:#5384 APPROVE 有效(独立八问结论见 #5384 review);#5384+#5388 组合树干净合并、46/46 通过;#5388 合并前仍需把正文 "Closes #5389" 改为 #5387(镜像编号错位,已在两个 PR 上留评论说明)。等待人工合并。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

这两条均为我在 GitHub PR #5384 上的评论(配对说明 + 更正说明)经上游同步回流,非新输入,内容已在此前的回复中覆盖。本线程终态:#5384 APPROVED;#5388 已含 revert 297925c、恢复原作者行为,待合并前改 "Closes #5389" → "#5387"。后续若无新的真人输入,不再回复同步回流。

@ranxianglei

Copy link
Copy Markdown
Owner

解决冲突重新review

@ranxianglei
ranxianglei force-pushed the 2026-11-01_proxy-summary-failed-classification branch from 97976a2 to e04fe66 Compare November 4, 2026 02:11
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决并重新 review 完毕。rebase 到最新 master 后已推回 PR 原分支,CI 正在新 head 上重跑。

冲突处理

重新 review(方向 + 回归)

  • 方向正确:修的是根因层——工具循环用「结果里是否含 FAILED」判定 proxy 工具调用成败,而成功压缩回执的后半段会内嵌模型写的摘要指纹行,摘要里引用过早期 FAILED 的工具输出时,整条被误判为失败,导致本该继续的回合提前结束。改成只看第一行状态行是对的层次。
  • 回归清点(逐个结果串生产者核对):所有失败回执第一行都以 [Compression FAILED: / [decompress FAILED: / [absorb FAILED: 开头(src/stream.ts:792/1009/1013/1025/1070/1305/1526、src/decompress-shared.ts:134 起一批、src/absorb.ts:89 起);成功回执第一行是 [Compressed …] / [Compression no-op: …](只有小写 "failed"),大写 FAILED 只出现在其后的摘要引用行 → 新判法下真失败不遗漏、误报消除。partial 成功回执里 inline 的 Errors: … 仍在第一行,判定不变。
  • 一个既有边缘(非本 PR 引入,前后行为一致):src/decompress-shared.ts:600 的 [Block … not found] 不含 "FAILED" 字样,循环一直把它当非失败处理——可见性标记侧另有 "not found" 分支兜住,此处不动。
  • 一个范围外观察:buildVisibilityMarker(src/loop/core.ts:76)对客户端 ❌ 图标仍是全文匹配,成功回执摘要引用 FAILED 时图标可能显示 ❌ 而循环按成功走——纯展示层不一致,不影响控制流,不在本 PR 范围。

验证

  • 本地 typecheck 干净;tests/plugin-protocol.test.ts 全量 23/23 通过,含 PR 新增的两个回归测试(proxy 压缩后继续工具循环;含 FAILED 的成功回执照常继续)。
  • 镜像 CI:新 head e04fe664b 上 mergeable_state 已从 dirty 转 blocked(冲突解除、等必选检查),11 项排队中,当前 0 失败。全量结论以远程 CI 为准。

八问:

  1. 是什么问题:PR 分支与 master 分叉无法合并(dirty);冲突根因是两个独立变更在同一位置各插了一个函数。
  2. 什么原因导致的:Anthropic-wire upstream without thinking signatures (DeepSeek /anthropic): compress re-request drops reasoning from the tool_use replay → 400 "content[].thinking must be passed back" #5495 与本 PR 先后改了 src/loop/core.ts 相邻区域,文本级冲突。
  3. 影响范围与严重程度:仅影响本 PR 自身可合并性,无运行时影响;PR 卡在 dirty 两天多进不了 CI。
  4. 怎么修复的:rebase 到最新 master,唯一冲突处双函数共存(master 优先、PR 函数随后),force-push 原分支。
  5. 是否有回归问题:无。既有行为逐项过完(见上回归清点):首行判定与全部成功/失败回执的真实格式吻合,无误报消除之外的语义漂移;测试合并无损。
  6. 是否破坏缓存:不涉及——未触碰缓存/重试/增量游标机制。
  7. 是否改了设计方向:不涉及——纯冲突解决,PR 原修复方案原样保留。
  8. 是否引入新配置:不涉及。

判定:冲突解决完成、重新 review 通过,待 CI 转绿后可合(合并留给你:https://github.com/ranxianglei/billion-context/pull/5384)。

@ranxianglei

Copy link
Copy Markdown
Owner

master是不是已经修复了这个问题

@ranxianglei
ranxianglei force-pushed the 2026-11-01_proxy-summary-failed-classification branch from e04fe66 to c5ea1e1 Compare November 5, 2026 15:26
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

没有,master 还没修这个问题,这个 PR 仍然需要。

查证(origin/master 最新 b947a0363):

  • proxyToolResultFailed 在 master 上不存在;
  • 5 处调用点仍是旧写法 pr.result.includes("FAILED")(src/loop/core.ts:1474、1495、1585、1703、1710)——成功压缩回执里引用过 FAILED 的摘要仍会被误判为工具失败。

顺带处理:我上一轮 rebase 之后 master 又前进了(1b7a661a2 → b947a0363,含 #5696 keyring-429、#5683 压缩门等 107 个文件)。已把 PR 再次 rebase 到最新 master:

  • 冲突仍是同一处(src/loop/core.ts 两个函数同位置插入),解法同上:master 的 isReasoningRequiredError 在前、PR 的 proxyToolResultFailed 在后,双方代码零改动;新窗口对 core.ts 的改动都在 429/keyring 区域,与本修复无语义交互。
  • rebase 后 PR head = c5ea1e1ba(基于当前 master),与 master 的 diff 仍只有 PR 原本的 2 个文件,作者信息保留。
  • 本地验证:typecheck 干净;tests/plugin-protocol.test.ts 23/23 通过(含 PR 新增的两个回归测试)。

CI 状态:上一个 head e04fe664b 已全绿(30 项检查 0 失败);新 head c5ea1e1ba 镜像缓存下个轮次跟上后即在其上重跑,当前无失败项。

结论:问题未修、PR 方向正确且已对齐最新 master,可随时合(合并留给你:https://github.com/ranxianglei/billion-context/pull/5384)。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

本轮处置完毕:红 CI 不是本 PR 的代码问题——是已登记的时序 flake。已触发重跑,零代码改动。

事实链:

八问:

  1. 是什么问题:本 PR CI 最后一处红是单个测试分片里一个时序敏感断言偶发落空;PR 自身代码无缺陷。
  2. 什么原因导致的:flaky 测试——settle 窗口后的行数读取在高负载分片上偶发少看到一行(expected 4 actual 3);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/941/956 已登记,兄弟 PR [PR] feat(session): split Claude Code SDK subagents into isolated session lanes #5726/[PR] fix(#5687): a tool-less MAIN turn must not be mistaken for a dsh sidecar - restores the BLOCKED-ref and wire-byte contracts #5709 同日同签名命中。
  3. 影响范围与严重程度:只影响 check 矩阵的信号可靠性(偶尔咬到别的 PR);无用户面影响;p3 级 CI 基建问题。
  4. 怎么修复的:无可修代码——零代码改动,rerun-failed-jobs 清掉(本地 3×6/6 绿 + 其余 29 项全绿证明树本身是绿的),CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 留痕供哨兵跟踪。
  5. 是否有回归问题:无。逐项:diff 仅动 core.ts 五处工具结果分类判定与 plugin-protocol 测试;失败测试及其 settle/存储路径与 diff 无交集;高危模式(语义漂移/fail-fast 变吞错/阈值时序漂移)均不涉及。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/增量游标/去重键)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入新配置:不涉及。

另注:分支现对 master 状态为 behind(master 又前进了,上一轮已核实前进窗口 5 个提交不触碰本 PR 任何文件,无冲突风险)。

判定:PR 侧无阻塞——等重跑结果即可转绿;若再次 flake,按车道政策升级处理。合并权在你:#5384

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

[bot] 进度汇报(进程曾卡住被重启,现已恢复并确认终态):

CI 已全绿。 镜像缓存最新读取(fetched_at 2026-11-05T17:20:10Z,head c5ea1e1ba):30/30 check 通过,failed=0 / pending=0——之前唯一的红分片 test (ubuntu-latest, 24, 2) 经 rerun-failed-jobs 重跑后转绿,印证了 flake 判定。

本轮已完成的全部动作:

  1. 诊断:唯一失败 = 已登记的 msgid-lane-flow settle-race 时序 flake(tests/msgid-lane-flow.test.ts:139,expected 4 actual 3;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/941/956 同签名,[PR] feat(session): split Claude Code SDK subagents into isolated session lanes #5726/[PR] fix(#5687): a tool-less MAIN turn must not be mistaken for a dsh sidecar - restores the BLOCKED-ref and wire-byte contracts #5709 同日命中);本地连跑 3×6/6 绿;与本 PR diff(core.ts FAILED 分类)无因果链。
  2. 处置:零代码改动,触发 rerun-failed-jobs(HTTP 201)→ 已转绿;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 留了一行结论(comment 6664270306)。
  3. 八问结论已在上一条回复给出(回归:无;缓存/设计方向/配置面:均不涉及)。

当前状态:分支对 master 为 behind(无冲突风险,上一轮已核实前进窗口不触碰本 PR 文件),CI 全绿,PR 侧无任何阻塞。合并权在你:#5384

@ranxianglei

Copy link
Copy Markdown
Owner

Landed via batch PR #6482 (merged) — closing as superseded.

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

Labels

bug Something isn't working hermes 改动范围:内核之外的主机侧接线(src/agent 适配器、server 路由、注入拦截)/范围兜底/客户端标签 p2 review发现小问题 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Successful compression can end the turn when its summary contains FAILED

3 participants