Skip to content

tool_output stream events don't distinguish between success and error states #1579

@habema

Description

@habema

Problem

When an agent invokes a tool, the tool_output stream event always has the same structure regardless of whether the tool succeeded or failed. Both successful results and error messages end up in the output field with no indication of which is which.

This makes it impossible for a UI to properly present tool execution results - it can't tell if the output represents a successful tool result or an error message.

Current Behavior

RunItemStreamEvent(
    name="tool_output",
    item=ToolCallOutputItem(
        output="some result",  # Could be success OR error message
        raw_item={...},
        agent=agent
    )
)

My question; is this behavior intentional? Are there design reasons for not distinguishing success/error states? Is extending the ToolCallOutputItem data model to have an is_error flag a welcome contribution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions