Skip to content

Responses API drops file_editor.view images (tool ImageContent not delivered to model) #1894

Closed

Description

@Wangmerlyn

Summary

When the agent views an image via file_editor and the LLM uses the OpenAI Responses API, the tool's ImageContent is dropped during
serialization. The model never receives the image (no input_image / image_url in payload), so it says it “can’t see” the picture.

Steps to Reproduce

  1. Use a vision-capable OpenAI model in Responses mode.
  2. Call file_editor.view on an image file (png/jpg/etc.).
  3. Inspect the serialized payload (LLM_PAYLOAD_LOG_PATH or logging): content contains the data: URL, but output_items lacks any
    input_image/image_url.

Expected

Tool observations containing images should be preserved and sent to the model in the Responses payload.

Actual

Images are stripped; only text outputs are sent. As Tony Horton in slack channel mentioned, agents do not say they had an issue accessing it, they just make something up.

Impact

  • Agents using Responses API cannot perceive images returned by file_editor.view.
  • Can lead to incorrect behaviors and wasted tokens/debug time.

Environment

  • Branch: main (latest main 6ce3ba5)
  • Affected file: openhands-sdk/openhands/sdk/llm/message.py (tool serialization in Responses path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    llm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions