Skip to content

Tool CallToolResult only processes first content item when multiple are returned #6211

@mango766

Description

@mango766

Hi there,

I noticed that when a tool returns a CallToolResult with multiple content items (e.g. both text and an image), only the first item gets processed. The rest are silently dropped.

Looking at tool_loop_agent_runner.py, the handler checks res.content[0] directly instead of iterating over all items in res.content. This means the LLM only sees partial results from tools that return rich/multi-part responses.

This seems related to #6140.

I have a fix ready — happy to open a PR if that works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coreThe bug / feature is about astrbot's core, backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions