-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: subsequent tool call args are empty for gpt-5 #8948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Keep this PR in a mergeable state → Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
|
Reviewed this PR for documentation updates. No documentation changes needed because:
The fix is well-documented in the PR description and commit message, which is appropriate for an internal bug fix like this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
RomneyDa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uinstinct nice digging to find the root cause here. The handleToolCallsInMessage which is removed here is the only path which is reached if there is no thinking for streamed tool calls. It seems like removing this would break tool calls for many other models/situations (not fully sure). Could we instead update handleToolCallsInMessage so that it doesn't add the extraneous character which is causing the parsing failures?
|
@RomneyDa Actually the reason for removing I had tested them on other models and all seem to work fine. The only model which replicated the tool call behaviour sometimes (i.e. tool call without any message content) was kimi k2, which was also working fine. |
RomneyDa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uinstinct thanks for the explanation!
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.37.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.34.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |

Description
Previously, the subsequent tool calls for gpt-5 models always produced empty tool arguments. This PR fixes that
Diagnosis:
GPT-5 models tend to be less verbose between tool calls - meaning they do tool calls without explanations in between.
streamUpdatewas transforming the second tool call message twice here and here for the same first message after the tool call.This added an extra character (for example,
"{\at the beginning of"{\"{\"command\":\"pwd\",\"waitForCompletion\":true") for which parsing the arguments failed.resolves CON-4997
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
before.mp4
after.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Fixed empty tool arguments on subsequent GPT-5 tool calls by removing duplicate processing of the first message after a tool call. This prevents a stray leading character that broke JSON parsing and ensures tools receive correct args across consecutive calls (CON-4997).
Written for commit de5062f. Summary will update automatically on new commits.