Skip to content

[BUG] ScreenshotToolkit.read_image re-enters current agent and breaks tool-call chain #3869

@Wendong-Fan

Description

@Wendong-Fan

Required prerequisites

Motivation

ScreenshotToolkit.read_image() currently calls self.agent.step(...) inside the tool implementation.
When this tool is invoked by the same agent, it creates a re-entrant step() call during tool execution and can corrupt
the tool-call message sequence.

This leads to request failures like:

400 Bad Request: An assistant message with 'tool_calls' must be followed by tool messages responding to each
'tool_call_id'...

Solution

No response

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions