Skip to content

Python: Responses API: missing status field on function_call / function_call_output items #4701

@ltwlf

Description

@ltwlf

When using AG-UI client-side tools with AzureOpenAIResponsesClient, follow-up requests that include tool call history fail with 400 Bad Request because the Responses API requires a status field on function_call and function_call_output items.

The root cause is in RawOpenAIResponsesClient._prepare_content_for_openai:

  • function_call items get "status": None (line ~1168) — API rejects null
  • function_call_output items omit status entirely (line ~1194) — API requires it

The API expects status to be "in_progress", "completed", or "incomplete".

This only surfaces with AG-UI client-side (declaration-only) tools because server-side tools use previous_response_id chaining and never re-serialize tool history as input.

Workaround: monkey-patch to add "status": "completed" on both item types.

Versions: agent-framework-core 1.0.0rc3, agent-framework-ag-ui 1.0.0b260304, Python 3.13

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions