Repository navigation
Conversation
A request with no tools that asks for a JSON reply (response_format json_schema/json_object, or text.format on the Responses wire) is a utility call, not an agent turn. Child processes of a host inherit the proxy through HTTP(S)_PROXY, and adding the ACP tools to their extraction calls makes backends that refuse tools plus response_format answer 400. Tool-carrying requests and an explicit main persona are still main turns. Fixes ranxianglei#5073 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Output The helper is only called by isSideRequest() inside the same module; no other file imports it, so the unused-exports gate rejects the leading export. Behavior is unchanged.
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 按失败签名(toolless + response_format + 注入工具后 400 / Hindsight / hermes 代理继承)检索 open+closed issues 与 PRs,无既有条目。 标签: bug, hermes, scope/wiring, p2(特定条件下记忆抽取子调用被上游拒收;有绕行、不影响核心 agent 回合 → p2)。 审查进展(首报): 方向审核:正确。 根因在 复现验证:
发现 1 处 CI 红(非 master 继承红): 按「小问题直接修」,正在 PR 分支补一个标注 commit:①去掉多余的 |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复——失败签名( 标签:bug / hermes / scope/wiring / p2(前序会话已打好,复核一致:Hermes 车道请求分类缺陷,功能问题有绕行面)。 CI 的 八问
判定:小修已闭环,等 CI 重跑;若全绿即可进入正常 review/合并流程(合并由人执行)。 |
Review supplement on 7a29d54 (ranxianglei#5074): every classification rule in this file carries its issue number as a comment anchor (ranxianglei#2500/ranxianglei#2503/ranxianglei#3149/ranxianglei#4438); the two comments added by ef508e9 did not, so the rule's provenance was not greppable. Comments only - no behavior change.
[bot] (ai: vllm-qwen/qwen3.8-27b) 重启后状态确认:unused-exports 修复已端到端闭环。
结论:CI 侧无任何遗留问题,PR 处于可 review 状态;合并由人执行(review/merge 是人工门禁)。本自动修复车道收工。 |
(ai: vllm-qwen/qwen3.8-27b) 最终结论(结构化八问)
验证与处置记录
判定:可合并,等 owner 合并(agent 不代合)。 |
[bot] (ai: vllm-qwen/qwen3.8-27b) 重启后进度汇报:无阻塞——重启前工作已全部闭环,刚复核状态无变化。
|
|
The four red lanes were master-red, not this change. The branch tree predated the #5046/#5018 storage convergence (2026-10-30/31), so the merge preview ran the new unified-storage second-writer guard (
Fix: merged Verified locally on the merged tree:
|
[bot] (ai: vllm-qwen/qwen3.8-27b) 收到,已对你的合入做了独立核验(不采信自述、逐项对过): 核验结果
八问(本轮为核验轮)
标签:沿用 bug / hermes / scope/wiring / p2(本轮无新缺陷面,存储守卫家族在 #4599 在档)。 判定:结构核验全部通过,等 test 分片跑完;若全绿即可进入正常 review/合并流程(合并由人执行)。 |
|
Re-triggered CI by closing/reopening this PR (no new commit; Status of the previous run (
The PR's own diff on top of current |
[bot] (ai: vllm-qwen/qwen3.8-27b) 对「剩余两个红是 master 既有 flake」的判定做了独立取证(不采信自述): 核验结果
八问(核验轮)
标签:沿用 bug / hermes / scope/wiring / p2(#2129 flake 属 master 侧,证据已同步 #4599,不在本 PR 立项)。 判定:继承 flake 归属成立(日志级证据);等新 run 出结果——若 ubu22-s1 再次命中 #2129,那是 master/ci-fixes 哨兵通道的事,不阻塞本 PR 的 review。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Verdict: APPROVE — correct, minimal, teeth-verified fix; regression audit clean.
What I verified (independent of the issue-side analysis)
Correctness. The new predicate requestsStructuredOutput (src/server/side-request.ts:80-86) matches exactly the two documented structured-output carriers — OpenAI chat-completions response_format.type ∈ {json_object, json_schema} and Responses-wire text.format.type — and can only fire on a toolless request, because its call site (side-request.ts:106) sits AFTER the #546 tools veto (line 100). Explicit host intent keeps precedence: "title" claims at line 91, requestAgent === "main" vetoes at line 92, both before the new rule. Matched requests then ride the existing #388 verbatim side passthrough: nothing injected, kernel state untouched, no usage sampling.
Tests have teeth. Ran tests/side-request-isolation.test.ts locally at PR head: 36/36 pass. Negative control: checked out master's side-request.ts into the same tree and re-ran → exactly the two new tests fail ("isSideRequest: a toolless structured-output request…" / "e2e: …forwarded without injected tools"), 34/36 pass — confirming the author's fail-on-master claim. The suite pins both gate directions (positive rows + {type:"text"}/null/bare-string negatives + #546-precedence row + explicit-main row), and the e2e control case pins that a toolless NON-structured large-budget request still gets tools injected — the main-turn path is not over-broadened.
Regression audit — existing behaviors on the touched paths:
- explicit side persona ("title") → unchanged
- explicit "main" persona → unchanged (vetoes before the new rule; unit-pinned)
- #2500 server-tool utility call → unchanged (checked before)
- any tool-carrying request → main turn, unchanged (#546 veto precedes; unit-pinned)
- toolless NON-structured request (any budget) → main turn, unchanged (e2e control pinned)
- ≤200-token budget heuristic → unchanged outcome
- session keying: this class now resolves VERBATIM instead of through the persona-order resolver — consistent with the #2156 doctrine that side requests never claim an anchor
No wire-shape change, no config surface, no kernel/, no persistence change. CI green (mirror cache: failed 0 at head 15573c3).
Behavior change (intended, disclosed)
Old: a toolless request carrying response_format {json_object|json_schema} (or Responses text.format) was classified as a MAIN turn → proxy mode injects the six ACP context tools next to response_format → strict backends reject the pair outright (HTTP 400); lenient backends let the model call context tools mid-extraction-task. New: classified as a SIDE request → forwarded verbatim, zero injection, kernel untouched. This is the fix itself (#5073); every other classification is unchanged per the audit above.
Informational finding (non-blocking)
The side-lane decision happens AFTER restoreOutputBudget runs — src/server/handle.ts:1988 gates only on !demotedSide && !serverToolUtility, not on isSideRequest. A toolless structured call with max_tokens=64000 therefore still records outputBudgetHighWater=64000 on its resolved session before diverting — the same seeding class #1897/#2500 skip for their side shapes. This is NOT a regression introduced by this PR: on master the identical request was a full main turn recording the same high-water (plus snapshot/usage pollution), so the PR strictly improves things; and in the reported topology Hindsight gets its own pfa- session (system-fingerprint fork), so there is no reattach risk at all. Companion open PR #5090 additionally skips restoreOutputBudget for this class and adds an honest log label — if this PR ships, cherry-picking that hunk closes the residual corner (one session id shared between main turns and a structured utility whose budget exceeds the provider cap, plus later starvation). Flagging for the owner, not blocking on it.
Duplicate notice
PR #5090 (opened 2026-10-29, after this branch already existed) fixes the same issue #5073 via the same mechanism plus the extra hardening above. Per 先来后到 this earlier PR takes precedence; the owner should pick one and close the loser (agents may not close PRs). Both are rebased onto current master and green.
中文结构化八问
- 是什么问题:继承宿主代理的子进程(如 Hermes Hindsight)发出的「无工具+结构化输出」请求被当成主回合处理,bili 注入的 6 个 ACP 工具与 response_format 同线出现,严格后端直接 400,此类调用全挂。
- 什么原因导致的:
isSideRequest()分类器缺少「无工具+结构化输出载体」信号;大 max_tokens(64000)又打穿了 ≤200 的预算启发式,请求落入主管道并被注入工具。 - 影响范围与严重程度:所有经 bili 代理、无工具且带 json_object/json_schema(或 Responses text.format)的调用在严格后端上全部失败;带工具的正常 agent 回合不受影响——特定调用类不可用,非会话丢失/缓存泄露,p2。
- 怎么修复的:分类器里加一个结构性谓词(无工具+两个已记录的结构化载体之一),复用既有 #388 逐字旁路;不引入新机制,不动 wire/config/kernel。
- 是否有回归问题:对触碰路径逐项清点(见上 audit),除有意降级外全部保持;本地负向控制确认仅 2 个新测试翻转。唯一残留是 high-water 记账(master 既有行为,非本 PR 引入,#5090 另行补强)。
- 是否破坏缓存:不涉及——逐字转发不改任何内核状态;出站前缀比注入工具时更稳定。
- 是否改了设计方向:不涉及——只匹配两个有证据的载体(legacy 裸字符串 response_format、Gemini generationConfig 刻意不匹配),符合 evidence-per-client 纪律。
- 是否引入了新的配置:不涉及。
判定:可合(APPROVE)。核心修复正确且经负向控制验证,回归清点干净,diff 仅 2 文件 +65/-0 全部切题;high-water 残留与 #5090 的重复关系已如上披露,取舍由 owner 定。
…i#546/ranxianglei#388/ranxianglei#2500 Ship the classification as the exported isStructuredOutputCall predicate with the ranxianglei#546 no-tools veto built in, so handle() can consult it independently of isSideRequest and skip restoreOutputBudget for the call — its 64000 budget sizes a utility response, not a main turn, and must not seed outputBudgetHighWater (ranxianglei#1897/ranxianglei#2500 class). Give the ranxianglei#388 side passthrough an honest log label, and extend the e2e to assert kernel state, stats, snapshot, request counter and high-water are all untouched, mirroring the ranxianglei#2500 suite. The new high-water assertion fails without the restore skip and passes with it.
…request Union of intent resolved by hand in two places: the side-request import line and the resolveSideLane label ternary (master's ranxianglei#5656 isDshSingleShotSidecar alongside this branch's ranxianglei#5073 isStructuredOutputCall), plus the ranxianglei#1440 (G) import-allowlist comment and set. tsc clean; the eight side-lane suites pass 84/84 on the rebased head.
| // #2170 measure 1: the decision itself is resolveSideLane() (pure, | ||
| // truth-table-tested); demotedSide ⊆ lane==="side" by construction. | ||
| const sideLane = resolveSideLane({ countTokens, responsesCompact, protocol, stripApplied: demotedSide, sideIntent, requestAgent, sideLabel: serverToolUtility ? "server-tool utility call (#2500)" : dshTitleSidecar ? "dsh title-gen sidecar (#2503)" : dshReviewSidecar ? "dsh auto-review sidecar (#4438)" : ccTitleSidecar ? "claude-code title-gen sidecar (#5135)" : undefined }); | ||
| const sideLane = resolveSideLane({ countTokens, responsesCompact, protocol, stripApplied: demotedSide, sideIntent, requestAgent, sideLabel: serverToolUtility ? "server-tool utility call (#2500)" : structuredOutputUtility ? "structured-output utility call (#5073)" : dshTitleSidecar ? "dsh title-gen sidecar (#2503)" : dshReviewSidecar ? "dsh auto-review sidecar (#4438)" : ccTitleSidecar ? "claude-code title-gen sidecar (#5135)" : undefined }); |
There was a problem hiding this comment.
Oof. I don't love that our agents decided to have nested ternaries! That's an ugly practice!
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Verdict: APPROVE — the new head (e872e74) implements exactly what the prior review flagged as the single non-blocking finding, and everything else holds.
What changed since the prior review (a828e59)
The author addressed the informational finding directly:
- private
requestsStructuredOutput→ exportedisStructuredOutputCall(parsed)with the #546 no-tools veto built INTO the predicate (src/server/side-request.ts:88-90), mirroringisServerToolUtilityCall, so a caller consulting it independently can never demote a tool-carrying turn. - handle.ts:1982 now computes
structuredOutputUtility; the gate at handle.ts:1996 becomesif (!demotedSide && !serverToolUtility && !structuredOutputUtility)— the utility's 64000 budget no longer seedsoutputBudgetHighWater(the #1897/#2500-class residual I flagged). - Honest log label
"structured-output utility call (#5073)"added to the resolveSideLane sideLabel chain (handle.ts:2180); mutually exclusive with the server-tool label (that shape requires tools, this one vetoes them). - Tests: new unit rows pin the predicate's self-contained veto (tool-carrying → false,
{type:"text"}/null/non-object → false); a resolveSideLane row pins the label AND byte-stability of the historical reason strings when no label is passed; the e2e now asserts kernel state / stats / snapshot / request counter / high-water are all untouched, with the high-water assertion failing without the restore skip (author's claim — independently confirmed below). - Barrel export in src/server.ts + side-lane-invariants allowlist updated accordingly.
Verification (independent)
- Local at head e872e74:
tests/side-request-isolation.test.ts+tests/side-lane-invariants.test.ts→ 53/53 pass;npm run typecheckclean; zero stale references to the old predicate name. - Negative control: checked out base (bfabcd1)
src/server/handle.tsinto the same tree → exactly ONE failure: the extended e2e, expecting high-water 1024, actual 64000 — i.e. the restore-skip is load-bearing and the test has teeth. Restored → green again. - CI (mirror cache, head e872e74): 30 checks, failed 0, pending 0.
Regression audit (delta vs prior review)
- Tool-carrying requests (any budget/format): unchanged — the veto now lives inside the predicate, unit-pinned (
tools: [{}]→ false). - All other side classes (dsh title/review, cc-title, server-tool, ≤200 heuristic, explicit personas): untouched code paths.
- Log lines: new label only for the new class; historical reason strings byte-stable (unit-pinned).
- Barrel/invariants: additive only.
Round-1 audit conclusions (persona precedence, #546 ordering, verbatim keying per #2156, passthrough semantics) all still hold — the matching logic is unchanged, only name/export/veto-placement moved.
Behavior change (intended, disclosed)
Old (master): a toolless response_format {json_object|json_schema} (or Responses text.format) request was a MAIN turn — six ACP tools injected beside response_format (strict backends 400) AND its large max_tokens seeded outputBudgetHighWater. New: classified SIDE — forwarded verbatim via #388, zero injection, kernel state/stats/snapshot/counter untouched, and its budget no longer seeds the high-water (restoreOutputBudget skipped, #1897/#2500 parity). Both halves are the fix plus the hardening requested in the prior review.
Non-blocking note — one line of lockfile churn (fix prepared, could not be pushed)
The master-merge commit rewrote one metadata line in package-lock.json (dropped "hasShrinkwrap": true from the @earendil-works/pi-coding-agent dev-dep entry). Unrelated to the fix. I prepared a one-line revert commit (efa3f384e) but cannot land it: the head branch lives in the author's fork, which this account has no write access to (the repo 404s for it). Functionally inert for this project (npm ci resolves identical versions; the package is aliased to a stub in the bundle), so this does NOT block — but please drop that line before merging (or grant ranxianglei push on the fork and I'll land it).
Duplicate notice (unchanged)
PR #5090 fixes the same issue #5073 via the same mechanism; the two have now converged to near-identical shape. Per 先来后到 this earlier PR takes precedence; the owner picks one and closes the loser (agents may not close PRs).
中文结构化八问
- 是什么问题:继承宿主代理的子进程(Hindsight)的「无工具+结构化输出」调用被当主回合处理——注工具致严格后端 400,且其大预算污染 outputBudgetHighWater。
- 什么原因导致的:分类器缺「无工具+结构化载体」信号、大 max_tokens 打穿 ≤200 启发式;且旁路判定晚于 restoreOutputBudget,预算记账先于分流发生。
- 影响范围与严重程度:该类调用在严格后端全挂(p2,特定调用类不可用);high-water 污染为窄角场景(同一 session id 混用主回合与该类调用+预算超 provider 上限+后续饥饿恢复)。
- 怎么修复的:导出自含 #546 否决的结构化谓词(对齐 #2500 server-tool 模式),isSideRequest 复用之走 #388 逐字旁路;handle() 独立查询该谓词跳过 restoreOutputBudget 记账;日志加诚实标签。
- 是否有回归问题:无——带工具请求、其余 side 类、显式 persona、历史日志 reason 串逐项清点保持并有测试钉住;本地负向控制确认 restore-skip 有牙(摘掉后恰好 1 个 e2e 红)。唯一残留是 lockfile 一行漂移(非功能,见上,请合前删掉)。
- 是否破坏缓存:不涉及——逐字转发不改内核状态,e2e 钉住 state/stats/snapshot/counter/high-water 全部不变。
- 是否改了设计方向:不涉及——谓词匹配逻辑与上轮一致,仅改名/导出/否决内置;只认两个有证据的载体(evidence-per-client)。
- 是否引入了新的配置:不涉及。
判定:可合(APPROVE)。核心修复+上轮发现的高水位加固均已落地并经独立验证;仅剩 lockfile 一行漂移待作者合前删除(非阻塞)。
(ai: vllm-qwen/qwen3.8-27b) 复审完成(head e872e74):APPROVED(review #5790378937)——作者新提交 a828e59 已落地一轮复审指出的高水位加固(谓词自含 #546 否决+跳过 restoreOutputBudget+诚实日志标签);本地定向验证 53/53 绿、负向控制确认新 e2e 有牙、typecheck 干净、CI 30/30 全绿。唯一残留:master 合并带入的 package-lock 一行漂移(hasShrinkwrap)——作者 fork 无写权限无法代推,已在 review 中请作者合前删除(非阻塞)。重复 PR #5090 仍待 owner 二选一。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 复审完成(head e872e74):APPROVED —— review #5790378937。 做了什么:作者新提交 a828e59 恰好落地了一轮复审指出的唯一非阻塞发现(谓词导出为自含 #546 否决的 两个待 owner 事项:① master 合并带入 package-lock 一行漂移(hasShrinkwrap),修复 commit 已备好但作者私有 fork 无写权限无法代推——已在 review 中请作者合前删除(非阻塞);② 重复 PR #5090 同机制同 issue,先来后到本 PR 优先,请 owner 二选一(agent 不关单)。 |
|
Landed via batch PR #6482 (merged) — closing as superseded. |
…Output The helper is only called by isSideRequest() inside the same module; no other file imports it, so the unused-exports gate rejects the leading export. Behavior is unchanged. (cherry picked from commit 7a29d54)
Review supplement on 7a29d54 (ranxianglei#5074): every classification rule in this file carries its issue number as a comment anchor (ranxianglei#2500/ranxianglei#2503/ranxianglei#3149/ranxianglei#4438); the two comments added by ef508e9 did not, so the rule's provenance was not greppable. Comments only - no behavior change. (cherry picked from commit 17e82b7)
…nion in the lane-invariant pins The 5074 pick concatenated the pick-side comment lines onto the master-side comment of the (G) pin without newlines, commenting out the test( line and breaking the file.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Acknowledged — verified before replying: batch PR #6482 merged 2026-11-14T01:11Z, and current master ( Left open for you to close (agents don't close): this PR #5074 and its duplicate #5090. No further action needed from my side — the lockfile line I flagged was moot once the batch landed. |
Fixes #5073
What changes
isSideRequest()now returns true for a request that has no tools and asks for a structured JSON reply:response_formatof typejson_schemaorjson_objecton the chat wire, ortext.formatwith those types on the Responses wire. Such a request takes the #388 side passthrough, so it is forwarded verbatim with no ACP tools added.The classification ships as the exported
isStructuredOutputCall(parsed)predicate with the #546 no-tools veto built into it.handle()consults that predicate independently ofisSideRequest()— the same shape as the #2500isServerToolUtilityCallpredicate — so it can:restoreOutputBudgetfor the call. Itsmax_tokens(64000) sizes the extraction response, not a main turn; letting it through seedsoutputBudgetHighWaterand poisons the first starved restore (OMP extension injects tools and compression philosophy in helper prompts #1897/[bug] Claude Code 的 WebSearch 子请求被当成主对话:nudge 基准被搜索的 usage 重锚,导致提前折叠;每次搜索还被注入 bili 工具 #2500 class).structured-output utility call (#5073)— instead of themax_tokens<=200fallback that never described it.Order of the rules in
isSideRequest():mainpersona is still a main turn.response_format.Why
The Hermes plugin sets
HTTP(S)_PROXYin the Hermes process, so child processes inherit the proxy. The Hindsight memory daemon is one of them. Its fact-extraction calls have no tools, setresponse_format, and use a 64000-token budget, so they were classified as main turns and got the six ACP tools added. PolyStrata answers that combination with a 400, and every Hindsight retain failed. Agent turns always carry tools, so this rule does not touch them.The root cause is the classification, not the injection: a toolless structured-output request is a one-shot utility call, so the fix routes it through the existing #388 verbatim passthrough (the same treatment the #2500 server-tool utility call gets) rather than adding a new mechanism or changing the wire shape.
Tests
tests/side-request-isolation.test.ts:json_objectandjson_schema, and Responsestext.format, are side requests.{type:"text"}, a null or non-objectresponse_format, a tool-carrying structured request, and themainpersona are not.isStructuredOutputCall()is tested directly, including the no-tools veto, becausehandle()consults the predicate outside the [bug] bili dsh 长会话中 max_output_tokens 被压到 ≤200,主请求被误判为 side request 并绕过压缩 #546 guard.resolveSideLane()names the Hermes lane: proxy adds ACP tools to toolless structured-output requests from child processes, which strict backends reject (400) #5073 label and leaves the historical reason strings byte-stable.tools, itsmax_tokens, messages andresponse_formatunchanged, and leaves kernel state, stats, snapshot, request counter andoutputBudgetHighWateruntouched. The high-water assertion fails without therestoreOutputBudgetskip and passes with it.tests/side-lane-invariants.test.ts: the #1440 (G) import allowlist admits the new pure predicate.Locally, the six side-request suites (
side-request-isolation,side-lane-truth-table,side-lane-invariants,websearch-side-request,dsh-title-side-lane,dsh-title-sidecar-handle) pass,tsc --noEmitis clean, andcheck:unused-exports/check:test-import-graphare clean. The full suite is left to CI.We have run the same change in production on 0.1.208, patched into
dist/index.js. Hindsight retains went from 400 to 200, and normal Hermes requests still get the ACP tools.No config surface,
kernel/, or wire-shape changes.🤖 Generated with Claude Code