ToolOutput component is wrongly hidden when the tool message result is a empty string
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 283
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ToolOutput component implementation shown in the issue and inspect its guard and rendering path. Confirm that an empty-string result is displayed while missing output and error text remain hidden, then verify the behavior with the component's relevant checks or reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100