Skip to content

fix: runaway guard must not count Google-lane tool-call arguments as model output (#3358) - #3362

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-16_runaway-guard-google-funcargs
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-16_runaway-guard-google-funcargs

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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

Fixes #3358

What

The #3260 text-run circuit breaker (abort a turn after >=200 consecutive identical code points in decoded model text) walks every response frame and feeds text-family leaves (content/text/…) into its run counter, excluding tool-argument containers by key name. The exclusion list covered openai chat (arguments), anthropic (input) and Responses (event-type skip) — but Google-wire tool calls ride parts[].functionCall.args, where functionCall/args are NOT in the exclusion set while payload leaves ARE literally named content/text. Result: a model writing a file whose content contains 200+ identical characters (separator runs, placeholder = lines, long base64-ish runs) gets its WHOLE TURN ABORTED on the Google lane. Default-on, no knob.

This is the #1039 invariant (tool-call arguments are user intent — never filter/count them) broken on exactly one of the four wires bili speaks. Discovered in the #3331 release-window cross-audit (third-party audit flagged it; I verified link-by-link in source before fixing).

Change

src/runaway-guard.ts: add functionCall, args, parameters to EXCLUDED_BRANCHES (+ comment documenting why each wire's container needs its own key — that propagation-by-key fact is what let this slip).

Tests

tests/runaway-guard.test.ts:

  • regression: google SSE frame with functionCall.args.content = 300 identical chars → does NOT trip, byte-exact forward (verified RED on unfixed code, GREEN with fix);
  • control: same wire's genuine model output parts[].text = 250 identical chars → still trips as text-run (guards against over-exclusion).

Targeted suite: 16/16 green locally; full verdict = CI lanes on this head.

Behavior change disclosure

None intended beyond removing the false positive: legitimate turns that were being killed now complete; genuine degenerate model-output runs on every wire still trip as before.

…n lane (#3358)

The #3260 text-run guard counts decoded text-family leaves outside excluded
branches to catch single-codepoint output loops. Exclusion propagates by KEY,
and the list covered openai (arguments), anthropic (input) and responses
(event-type skip) — but google tool calls ride parts[].functionCall.args with
payload leaves named content/text, so a write-tool payload of >=200 identical
characters aborted the turn. That re-breaks the #1039 invariant (tool-call
arguments are user intent, never counted) on the one wire the original list
missed. Add functionCall/args/parameters to EXCLUDED_BRANCHES.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-16_runaway-guard-google-funcargs (2cccc08)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3963-pr.3362.b19949b

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-pr3362.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

Closing as duplicate of #3357 (first-come: #3357 was opened earlier and covers the identical mechanism — same three keys added to EXCLUDED_BRANCHES, equivalent JSON-built regression + control tests, placed in the issue3260 test file which is the canonical home for this feature). No unique content lost by closing this one.

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

Labels

None yet

Projects

None yet

1 participant