Repository navigation
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. Summary
Reviews (1) · Last reviewed commit: "fix(llm): distinguish duplicate tool cal..." · Reviewed by Greptile |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a provider returns two distinct tool calls with the same nonblank
call_idin one response, the turn guard keeps the collision. The SDK then collapses results in the next request's history, and the per-turn limiter treats the distinct calls as one decision. Recycling a historical ID into two new calls produces the same problem.Associate the assigned ID with the response item's identity, using its output position on Chat Completions routes where the SDK uses a shared placeholder item ID. Keep assignments stable through added/done/completed events, preserve the first valid ID, and give subsequent collisions distinct IDs. This extends the existing normalization without changing tool execution or provider routing.
Closes #1611.
Validation on macOS/Apple Silicon, Python 3.12.14, against upstream
98e3df14:pytest -q tests/test_tool_call_ids.py tests/test_tool_call_limits.py tests/test_tool_call_ids_providers.py: 454 passed, 3 expected failures. This exercises 18 provider-route model configurations in streamed and non-streamed modes. The existing expected failures concern SDK conversion of null IDs before the guard runs; dependency deprecation/unclosed-session warnings remain.git diff --checkpasses.make check-allstill stops at Pyright: 936 errors versus 940 on unchanged upstream. A comparison of diagnostic file/rule/message signatures, normalized for checkout paths and line shifts, finds no new diagnostics.All provider responses are synthetic, served on loopback through the actual SDK and LiteLLM adapters. No live provider, LLM account, Docker scan or external target was exercised.