Skip to content

fix: pair V2 tool results with their own call when IDs repeat - #683

Merged
Tarquinen merged 2 commits into
devfrom
fix/v2-tool-result-pairing
Nov 16, 2026
Merged

Tarquinen merged 2 commits into
devfrom
fix/v2-tool-result-pairing

Conversation

@Tarquinen

Copy link
Copy Markdown
Owner

Fixes #661

  • V2 projection paired tool results by call ID across the whole conversation. Providers that reuse IDs (Kimi's functions.shell:0) made a compressed call's result stay in the request with no call, which strict providers reject.
  • Results now pair with the closest preceding call with the same ID.

Tested: unit test with reused IDs; sandbox on OpenCode 2.3.0 with kimi-k3 and repeating tool IDs: before, the post-compression request had an orphan tool message and failed with "Kimi K3 tool messages need a resolvable tool name"; after, no orphan and the turn succeeds.

@Tarquinen
Tarquinen merged commit 44418a0 into dev Nov 16, 2026
1 check failed
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.

1 participant