Skip to content

fix(#3358): exclude google functionCall tool-call args from the text-run guard - #3375

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-16_fix-3358-google-functioncall-args
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-16_fix-3358-google-functioncall-args

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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

Closes #3358

What / why

The #3260 text-run breaker walks every decoded frame and feeds text-family leaves (content/text/…) into the run tracker, with exclusion propagated by BRANCH NAME via EXCLUDED_BRANCHES. OpenAI (arguments), Anthropic (input) and Responses (event-type skip) are all covered — but the Google lane nests tool calls under candidates[].content.parts[].functionCall.args, and neither functionCall nor args was excluded. Google frames carry no top-level type, so the event-level exemption cannot reach them either. Result: a write/edit-tool payload whose arg field is named content or text and holds ≥200 consecutive identical characters (separator lines, base64 runs) aborted the whole answer. This breaks the #1039 invariant (tool arguments are user intent, never counted) on the Google lane.

Fix

EXCLUDED_BRANCHES += functionCall (covers everything under it, incl. all of args), plus defensive args / parameters. Key-name propagation already handles the rest of the subtree. No wire bytes are touched — the guard only decides whether to trip; forwarding stays byte-exact.

Behavior change (flagged per policy)

Old: Google-lane turns whose tool-call args contained a ≥200-codepoint run in a field named content/text were aborted mid-stream (clean EOF, upstream cancelled). New: those turns complete normally. Genuine model-text runs (e.g. parts[].text) still trip at the same threshold — pinned by the control test.

Tests

New tests/issue3358-google-functioncall-args.test.ts (4 cases): args.content 300×= does NOT trip; args.text 300×- does NOT trip; control parts[].text 250×= DOES trip as text-run (guards over-exclusion); mixed frame (prose part + huge arg part) passes byte-exact. Verified the first/third/fourth FAIL on the pre-fix code and pass after. Existing runaway-guard + #3260 suites (35 tests total across the three files) green locally; typecheck/build/unused-export/import-graph gates clean.

No config surface added. Meets the §7.4 auto-merge gate checklist (single-module pure fix, regression test, rebased head, no wire/config/persistence change); merge stays human.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-16_fix-3358-google-functioncall-args (2bcf39f)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3978-pr.3375.faf8b55

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3375.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

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

查重:重复——与 #3357 100% 重复(同症状 + 同机制 + 同根因,diff 逐一比对确认):

  • 症状相同:Google 线路工具调用参数(functionCall.args 下名为 content/text 的字段)含 ≥200 连续同码点时,text-run 熔断把整个回答掐断;
  • 机制相同:src/runaway-guard.ts 的 EXCLUDED_BRANCHES 缺 Google 线分支名;
  • 修法相同:两个 PR 都往 EXCLUDED_BRANCHES 加同样的三个名字 args/functionCall/parameters(顺序不同,集合等价)。

#3357(创建于 06:20Z)比本 PR(~07:20Z)早约一小时。按先来后到:保留 #3357,本 PR 以重复关闭,本 PR 的增量价值(额外回归测试用例)移植进 #3357。

方向判断(独立审核,非复读 issue):机制成立——已逐行核对源码:walker(collectText)按分支键名向下传播排除,Google 帧无顶层 type,事件级豁免够不着,参数里的 content/text 恰好命中 TEXT_LEAF_KEYS;修法打在根因(补缺失分支名)上,不是表面打补丁。#1039 不变量(工具参数是用户意图,绝不计数)在 Google 线路恢复闭合。diff 干净(2 文件,每行都与目的相关)。

接下来:① 实证验证修复前后行为(含核对本 PR「第 1/3/4 例修复前失败」的说法);② 把本 PR 独有的两个用例(第二叶子拼写 args.text、混合帧字节原样)作为附加 commit 移入 #3357 分支;③ #3357 正文补 Closes #3358(规范 issue,否则合入后 #3358 无人关闭);④ 本 PR 打重复标签关闭,#3358 线程指向 #3357。完整八问结论随后补。

ranxianglei pushed a commit that referenced this pull request Oct 16, 2026
…3358)

The closed duplicate covered the args.text leaf-key spelling and the
mixed prose+arg frame shape; absorb both so the keeper PR pins them too.
@ranxianglei

Copy link
Copy Markdown
Owner Author

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

以重复关闭——与 #3357 重复:

  • 症状相同:Google 线路工具调用参数含 ≥200 连续同码点时,text-run 熔断把整个回答掐断;
  • 机制相同:src/runaway-guard.ts 的 EXCLUDED_BRANCHES 缺 Google 线分支名;
  • 修法相同:两个 PR 都加同样的三个名字 args/functionCall/parameters(diff 比对确认集合等价)。

#3357 早约一小时创建(06:20Z vs 07:20Z),按先来后到保留先到的。本 PR 的独有价值——两个额外回归用例(args.text 第二叶子拼写、混合 prose+arg 帧字节原样)——已移植进 #3357 分支作为附加 commit(d686c80);#3357 同时 rebase 到最新 master,正文补了 Closes #3358。

完整审核结论(八问)见镜像 issue 的 review 线程。合并留给人:#3357

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

Labels

duplicate This issue or pull request already exists

Projects

None yet

1 participant