Skip to content

ToolOutput component is wrongly hidden when the tool message result is a empty string #399

@BHznJNs

Description

@BHznJNs

Currently the ToolOutput component implementation has a guard statement:

export const ToolOutput = ({
  className,
  output,
  errorText,
  ...props
}: ToolOutputProps) => {
  if (!(output || errorText)) {
    return null;
  }
  ...

The expression !(output || errorText) will wrongly returns true when the output is an empty string.
And for example, I have a read_file tool, and the agent use it to read a empty text file, sometimes the tool implementation will return an empty string here, and this expression will make the tool result be hidden.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions