Skip to content

[PR] fix: repair overlapping tool groups with a linear sweep - #6140

Closed
Afloat16 wants to merge 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-10_linear-tool-pair-repair
Closed

Afloat16 wants to merge 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-10_linear-tool-pair-repair

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

Hoisting before the directly enclosing call can move a message inside an earlier overlapping call/output pair, so a strict Responses backend still rejects the repaired history. Per-message scanning is quadratic, and spreading a large hoisted batch into push overflows the argument stack.

Changes

Merge overlapping intervals into ordered groups and sweep messages once, hoisting before the entire group. Preserve non-tool order, tool order, item identity and same-array no-op behavior. Append large batches without function argument spreading.

Validation

  • 15 targeted tests passed; three new cases fail on unchanged source: two overlapping groups and a 150,000-message batch.
  • Over 15,000 items/5,000 completed exchanges, the unchanged-array benchmark median across five local runs improved from 725.6 ms to 3.44 ms. This is a local measurement, not a cross-machine guarantee.
  • Final-code typecheck, npm production build with dist checks and git diff --check passed. Complete-suite verdict remains with CI.

Checked #768, #5675 and prior Afloat16 history. Call-family registration and orphan policy are unchanged.

Base: e1e33a9.

Closes #6139

@ranxianglei ranxianglei changed the title fix: repair overlapping tool groups with a linear sweep [PR] fix: repair overlapping tool groups with a linear sweep Nov 10, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

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

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

Confirmed the supersession before closing:

No further action needed on this PR — closing as superseded is correct.

@ranxianglei ranxianglei reopened this Nov 14, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

Status re-check (no new input since the last confirmation):

The thread is fully resolved — no further action needed from this side.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Tool-pair hoisting creates new traps for overlapping calls and scales quadratically

2 participants