diff --git a/site/src/pages/AgentsPage/components/ChatElements/tools/ExecuteTool.tsx b/site/src/pages/AgentsPage/components/ChatElements/tools/ExecuteTool.tsx
index 0a7c54d252..6f0a3b18f0 100644
--- a/site/src/pages/AgentsPage/components/ChatElements/tools/ExecuteTool.tsx
+++ b/site/src/pages/AgentsPage/components/ChatElements/tools/ExecuteTool.tsx
@@ -189,23 +189,20 @@ const ShellCommandLine: React.FC<{
? summarizeParsedCommands(parsedCommands)
: "";
const commandDisplay = summary || command;
+ const commandLabel = intentLabel
+ ? `${intentLabel} using ${commandDisplay}`
+ : `Ran ${commandDisplay}`;
+ const durationSuffix = durationLabel ? ` for ${durationLabel}` : "";
+
return (
<>
-
- {intentLabel ? (
- <>
- {intentLabel} using {commandDisplay}
- >
- ) : (
- <>Ran {commandDisplay}>
+
+ {commandLabel}
+ {durationSuffix && (
+ {durationSuffix}
)}
- {durationLabel && (
-
- {intentLabel ? ` for ${durationLabel}` : durationLabel}
-
- )}
{expanded !== undefined && (