Skip to content

Conversation

@houssemzaier
Copy link
Contributor

@houssemzaier houssemzaier commented Jan 19, 2026

Fixes #8773

When GPT-5 makes parallel tool calls via the Responses API, each function_call has a unique call_id (fc_*). These IDs were being overwritten instead of accumulated, causing:

"No tool call found for function call output with call_id fc_xxx"

Changes

  • gui/src/redux/slices/sessionSlice.ts: Accumulate IDs in responsesOutputItemIds[] array during streaming
  • core/llm/openaiTypeConverters.ts: Emit function_call for each tool call with positional ID matching
  • core/llm/openaiTypeConverters.test.ts: Added comprehensive tests for parallel tool call scenarios

How it works

  1. During streaming, when fromResponsesChunk sets message.metadata.responsesOutputItemId, we now accumulate these into an array responsesOutputItemIds[]
  2. When converting to Responses API input format, we iterate over all tool calls and match each one with its corresponding fc_ ID by position
  3. This ensures each parallel tool call gets its correct call_id when sent back to OpenAI

Test plan

  • Unit tests pass (14 new tests covering parallel tool calls, edge cases)
  • Manual testing with GPT-5 and GPT-5.1 parallel tool calls

Related: #8935


Continue Tasks

Status Task Actions
▶️ Queued Update docs on PR View

Powered by Continue


Summary by cubic

Fixes lost call_id mapping for parallel tool calls in the OpenAI Responses API, preventing “No tool call found for function call output” errors and restoring correct pairing between function_call and tool outputs.

  • Bug Fixes
    • Accumulate fc_ IDs during streaming in responsesOutputItemIds[] (keeps the singular field for backward compatibility).
    • Emit a function_call item for each tool call, matching IDs by position; also emit assistant text when present.
    • Add unit tests covering parallel calls, legacy scenarios, and edge cases.

Written for commit 4ad4a6e. Summary will update on new commits.

When GPT-5 makes parallel tool calls, each function_call has a unique
call_id (fc_*). These IDs were being overwritten instead of accumulated,
causing the error: "No tool call found for function call output with call_id"

Changes:
- sessionSlice.ts: Accumulate IDs in responsesOutputItemIds[] array
- openaiTypeConverters.ts: Emit function_call for EACH toolCall with matching ID

Ref: https://platform.openai.com/docs/guides/function-calling
@houssemzaier houssemzaier requested a review from a team as a code owner January 19, 2026 12:43
@houssemzaier houssemzaier requested review from sestinj and removed request for a team January 19, 2026 12:43
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jan 19, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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 3 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

No tool call found for function call output with call_id

1 participant