Repository navigation
Description
Summary
The existing integration test t08_image_file_viewing exercises FileEditor image viewing, but it only validates the final model response. The bug fixed in PR #1895 happens earlier: tool-role serialization for Responses API dropped ImageContent, so the LLM never received the image from file_editor tool observations. We should extend the integration test to explicitly assert that tool-role image content is serialized into Responses input items as input_image for tool observations.
Proposed approach
Update tests/integration/tests/t08_image_file_viewing.py to add a structural assertion during/after the run:
- After the run, iterate
self.llm_messages(capturedMessageEventLLM messages). - Find the first tool-role message for
FileEditorTool(or any tool message) whose content includesImageContent(fromfile_editor.view). - Serialize that
MessageusingMessage.to_responses_dict(vision_enabled=True)or viaLLM.format_messages_for_responsesand verify:- There is a
messageitem withcontentcontaining at least oneinput_imageentry (and no base64 in output text). - There is a corresponding
function_call_outputitem with the samecall_id(minimal output text) so call_id threading remains intact.
- There is a
If we prefer to keep the integration test black-box, add a smaller unit test in tests/sdk/test_message_responses.py (or similar) that constructs a tool Message with ImageContent and validates the Responses serialization matches the new behavior. However, reusing the integration test keeps the coverage closer to the real tool path.
Sketch (integration test)
# after run
from openhands.sdk.llm import Message, ImageContent
# find tool message with ImageContent
image_tool_msg = next(
m for m in self.llm_messages
if m['role'] == 'tool' and any(c.get('type') == 'image' for c in m['content'])
)
message = Message.model_validate(image_tool_msg)
items = message.to_responses_dict(vision_enabled=True)
assert any(
i.get('type') == 'message' and any(p.get('type') == 'input_image' for p in i.get('content', []))
for i in items
)
assert any(i.get('type') == 'function_call_output' for i in items)Acceptance criteria
t08_image_file_viewingfails on pre-fix code (no tool image in Responses serialization).t08_image_file_viewingpasses after PR fix(message): Responses tool image serialization (preserve file_editor images) #1895.- Test remains compatible with both Responses and non-Responses models (skip or guard if Responses not supported).
Activity
all-hands-bot commentedon Mar 27, 2026
This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.
all-hands-bot commentedon Apr 6, 2026
This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.