Repository navigation
Conversation
The client tool call pipeline only captured a single tool call per turn (last-write-wins). When the LLM called multiple client tools in one turn, only the last one was returned. - attempt.ts: change clientToolCallDetected from single value to array - types.ts: clientToolCall → clientToolCalls (array) - run.ts: build pendingToolCalls from full array - openresponses-http.ts: emit all function_call items in both non-stream and stream paths - Update test to match new array shape
Contributor
Greptile SummaryThis PR fixes a bug where only the last client tool call was returned to the caller when the LLM invoked multiple client tools in a single agent turn. The fix changes the internal detection mechanism from a single-value overwrite pattern to an array accumulation pattern across all 4 relevant layers. Changes:
Confidence Score: 5/5
Reviews (1): Last reviewed commit: "fix: support multiple client tool calls ..." | Re-trigger Greptile |
Contributor
Author
|
@joshavant Could you please take a look and merge this PR if it looks good? |
|
@charzhou what happened? i still have the issue on the latest release, what happened with your fix proposal? |
4 tasks done
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.
Summary
clientToolCallDetectedfrom a single-value variable to an array that accumulates all callsattempt.ts(detection),types.ts(type),run.ts(pendingToolCalls construction),openresponses-http.ts(non-stream + stream output)Root cause
In
attempt.ts, theonClientToolCallcallback overwrote a single variable on each invocation:Downstream,
run.tswrapped this single value into a 1-elementpendingToolCallsarray, andopenresponses-http.tsonly readpendingToolCalls[0].Test plan
/v1/responsesrequest with instructions to call 3 client tools in one turnfunction_callitems appear in the response (non-stream)function_callSSE events are emitted (stream)