Skip to content

OpenAI Responses JSON-stringifies image media returned from tool results #28859

@kitlangton

Description

@kitlangton

Problem

The native OpenAI Responses protocol lowers every tool-result into a string via toolResultText. For content-typed tool results, that JSON-stringifies the whole content array, including base64 image data URLs, into function_call_output.output.

That shape is wrong for screenshot/read tool results. It can make the request invalid or oversized, and the provider may only surface a generic stream error.

Expected

  • Tool-result image media should be emitted as structured OpenAI Responses input_image content.
  • Text/json/error tool results should keep the existing string behavior.
  • Unsupported non-image tool-result media should fail clearly.

PR

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions