Repository navigation
fix(parser): emit tool call arguments from added and done envelopes - #35
Merged
Merged
Conversation
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.
Closes CL-11975
Closes #34
What changed
registerToolCallBlockstores eachfunction_callitem's realcall_idand trackshasEmittedArgswhenresponse.output_item.addedregisters the block.inference.tool_call.deltaevents (both streaming and non-streamingparseJSONResponse) now carry the realcallIdalongsideindex.response.output_item.addedcarries a non-emptyitem.argumentsstring on afunction_call,parseResponseimmediately emitsinference.tool_call.deltaand markshasEmittedArgs.response.function_call_arguments.doneandresponse.output_item.done(item.type === "function_call") as fallback argument sources when no prior argument delta was emitted for thatitem_id, preventing parallel tool calls from finalizing with empty{}arguments while avoiding duplicate emission when deltas already streamed.ProtocolMismatchErrorfor afunction_callnever announced byoutput_item.added(previously ignored, silently dropping the call), matching the existing.deltarule.Verification
bun run check(typecheck, lint, format, 55 unit tests) passes.bun run test:e2e(6 e2e tests throughrunInference) passes.bun run buildsucceeds cleanly.