Conversation
Accept type:function_calls relay output when enableMultiToolCalls is true: every call is validated against forwarded function tools and the whole response fails safely to a final answer on any unavailable name or when maxToolCallsPerResponse is exceeded. Valid multi-calls render as multiple Responses function_call items with distinct suffixed call_ids over SSE and non-streaming output. Default remains disabled; single-tool behaviour is unchanged.
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.
What changed
Allows Hyperagent to request multiple independent Codex tool calls in one response, cutting one full Hyperagent round-trip per call down to one:
{"type":"function_calls","calls":[{name,arguments},…]}accepted only whenenableMultiToolCalls: true(default off).maxToolCallsPerResponse(default 3) → safe final answer with the counts.function_callitems with deterministic suffixedcall_ids (call_x_0,call_x_1…) over SSE and non-streaming JSON; auditoutputTypebecomesfunction_calls.Why it saves credits
One Hyperagent request can fan out several local reads/commands instead of burning a thread per tool call.
Testing
npm test: 79 pass, 0 fail (3 pre-existing skips). New tests cover parse/validation/fail-safe paths, inert-when-disabled (incl. legacy two-arg callers), SSE + non-streaming rendering with distinct call ids, and an end-to-end streaming bridge test.