diff --git a/frontend/src/components/v1/chat/event-content-helpers/get-observation-content.ts b/frontend/src/components/v1/chat/event-content-helpers/get-observation-content.ts index 35d01b0655..da2558af42 100644 --- a/frontend/src/components/v1/chat/event-content-helpers/get-observation-content.ts +++ b/frontend/src/components/v1/chat/event-content-helpers/get-observation-content.ts @@ -71,7 +71,18 @@ const getTerminalObservationContent = ( content = `${content.slice(0, MAX_CONTENT_LENGTH)}...`; } - return `Output:\n\`\`\`sh\n${content.trim() || i18n.t("OBSERVATION$COMMAND_NO_OUTPUT")}\n\`\`\``; + // Build the output string + let output = ""; + + // Display the command if available + if (observation.command) { + output += `Command: \`${observation.command}\`\n\n`; + } + + // Display the output + output += `Output:\n\`\`\`sh\n${content.trim() || i18n.t("OBSERVATION$COMMAND_NO_OUTPUT")}\n\`\`\``; + + return output; }; // Tool Observations