Skip to content

fix: handle missing type in schema and orphaned function calls in Responses API#2362

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fix-docker-agent-issue-2354-231c9e1e
Apr 10, 2026
Merged

fix: handle missing type in schema and orphaned function calls in Responses API#2362
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fix-docker-agent-issue-2354-231c9e1e

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 9, 2026

Summary

Fixes two Responses API errors reported in #2354:

  1. Schema validation error (additionalProperties missing type): Added ensureTypeFields() to the schema normalization pipeline to inject missing type keys. The OpenAI Responses API requires all schema nodes to have an explicit type.

  2. "No tool output found for function call": When a tool call was cancelled mid-batch, remaining unprocessed tool calls had no results added to the conversation history, causing orphaned function_call items. Fixed by adding error results for remaining calls on cancellation, plus a defensive safety net in convertMessagesToResponseInput that injects placeholder outputs for any orphaned function calls.

Closes #2354

…ponses API

- Add ensureTypeFields() to schema normalization pipeline to inject
  missing 'type' keys required by the OpenAI Responses API (fixes
  notion-search tool's additionalProperties rejection)
- Add error results for remaining tool calls when a batch is cancelled
  mid-way, preventing orphaned function_call items in conversation history
- Add defensive safety net in convertMessagesToResponseInput to inject
  placeholder outputs for any orphaned function calls

Closes docker#2354

Assisted-By: docker-agent
@dgageot dgageot requested a review from a team as a code owner April 9, 2026 14:07
@dgageot dgageot merged commit d060de4 into docker:main Apr 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Tool schema rejected by ALOY Responses backend — notion-search additionalProperties missing type key

2 participants