Repository navigation
fix(providers): stream "{}" for Kiro tool calls with no input - #18780
Merged
diegosouzapw merged 4 commits intoNov 4, 2026
Conversation
A Kiro tool call starts with `arguments: ""`. When Kiro sends no input for
it (a no-parameter tool, or optional parameters the model left out),
nothing replaces the empty string, so OpenAI clients reassemble `""` and
strict ones reject the call. At the terminal flush, send `"{}"` for every
started tool call that streamed no arguments, matching OpenAI.
The tool_call wrapper path now records the arguments it emits, so the
fill never appends to a wrapper call's JSON.
Closes cheaper-inference#18718
gaurav0107
marked this pull request as ready for review
November 2, 2026 18:21
…-calls-with-no-in
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…-calls-with-no-in
This was referenced Nov 4, 2026
diegosouzapw
merged commit Nov 4, 2026
2b5a61f
into
cheaper-inference:release/v3.8.53
3 of 37 checks passed
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
function.arguments: ""and nothing after it. Clients reassemble""and strict OpenAI clients reject the call. OpenAI sends"{}"in this case.flush()now calls a newflushEmptyToolCallArgshelper after the buffered-args flush and before the finish chunk. It sends"{}"for every started tool call that has streamed no arguments (missing,"", or whitespace only).messageStopEvent, so a late argument fragment can never be appended after an injected{}.flushPendingWrapperToolCallsnow records the arguments it emits intoolArgsEmitted. Without that, the fill would append{}to a validtool_callwrapper payload.Related Issues
function.arguments: ""instead of"{}", so strict OpenAI clients reject the call #18718""shape on the Claude translator path)Target Branch
release/v3.8.xbranch (release/v3.8.53), notmainValidation
eslint+prettier --checkon the changed files, andnpm run check:open-sse-typecheckrelease/v3.8.53tipWithout the fix, the new end-to-end test fails (the reassembled arguments are
""):With the fix, across the 15 test files that import
open-sse/executors/kiro.ts:Tests Added Or Updated
tests/unit/executor-kiro.test.ts: a stream with three tool calls: noinput,input: "", and an object input. The first two reassemble to{}, the third is unchanged, and the fill lands before thetool_callsfinish chunk. A second case checks that a validtool_callwrapper does not get{}appended.tests/unit/kiro-tool-args-streaming.test.ts: unit tests forflushEmptyToolCallArgscovering missing, empty, and whitespace-only arguments, a call that already streamed arguments, idempotence, and the no-tool-call case.Coverage Notes
open-sse/executors/kiro.tschange is covered by the two test files above. The new helper is exercised directly and throughtransformEventStreamToSSE, and every branch is covered.Reviewer Notes
changelog.d/fixes/18780-kiro-empty-tool-arguments.md.🤖 Opened with Superhuman, an open-source contribution agent.