What happened?
When an extension registers a tool with renderShell: "self" and returns a zero-height component (e.g. new Text("", 0, 0)) from both renderCall and renderResult, the tool row still renders as one blank line instead of disappearing.
The blank line comes from the unconditional new Spacer(1) in the ToolExecutionComponent constructor. The hideComponent flag would suppress it, but that flag is only set when hasContent === false — which is impossible when any renderer is defined, because hasContent = true is set unconditionally after the renderer callback returns, regardless of what the callback emits.
Steps to reproduce
Register any tool with renderShell: "self" where both renderCall and renderResult return new Text("", 0, 0). Run the agent. Each tool call leaves one blank line in the chat even though the renderer emits nothing.
Expected behavior
A tool whose renderer emits no visible content should take no layout space.
Fix (happy to submit a PR once approved)
In ToolExecutionComponent.render(), after super.render(), return [] if every line is an empty string:
const lines = super.render(width);
if (lines.length > 0 && lines.every((l) => l === "")) return [];
return lines;
This only fires when the renderer deliberately emits nothing, so existing behaviour is unaffected.
Version: 0.78.0
What happened?
When an extension registers a tool with
renderShell: "self"and returns a zero-height component (e.g.new Text("", 0, 0)) from bothrenderCallandrenderResult, the tool row still renders as one blank line instead of disappearing.The blank line comes from the unconditional
new Spacer(1)in theToolExecutionComponentconstructor. ThehideComponentflag would suppress it, but that flag is only set whenhasContent === false— which is impossible when any renderer is defined, becausehasContent = trueis set unconditionally after the renderer callback returns, regardless of what the callback emits.Steps to reproduce
Register any tool with
renderShell: "self"where bothrenderCallandrenderResultreturnnew Text("", 0, 0). Run the agent. Each tool call leaves one blank line in the chat even though the renderer emits nothing.Expected behavior
A tool whose renderer emits no visible content should take no layout space.
Fix (happy to submit a PR once approved)
In
ToolExecutionComponent.render(), aftersuper.render(), return[]if every line is an empty string:This only fires when the renderer deliberately emits nothing, so existing behaviour is unaffected.
Version: 0.78.0