From 17821f782e295720f5a7d3bdda5e85c79b91a37f Mon Sep 17 00:00:00 2001 From: Neha Prasad Date: Fri, 5 Dec 2025 20:15:28 +0530 Subject: [PATCH] feat: display command in observation block (#11885) Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com> --- .../chat/event-content-helpers/get-observation-content.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/components/features/chat/event-content-helpers/get-observation-content.ts b/frontend/src/components/features/chat/event-content-helpers/get-observation-content.ts index 56bf582263..435a686918 100644 --- a/frontend/src/components/features/chat/event-content-helpers/get-observation-content.ts +++ b/frontend/src/components/features/chat/event-content-helpers/get-observation-content.ts @@ -22,6 +22,13 @@ const getCommandObservationContent = ( if (content.length > MAX_CONTENT_LENGTH) { content = `${content.slice(0, MAX_CONTENT_LENGTH)}...`; } + + const command = event.observation === "run" ? event.extras.command : null; + + if (command) { + return `Command:\n\`\`\`sh\n${command}\n\`\`\`\n\nOutput:\n\`\`\`sh\n${content.trim() || i18n.t("OBSERVATION$COMMAND_NO_OUTPUT")}\n\`\`\``; + } + return `Output:\n\`\`\`sh\n${content.trim() || i18n.t("OBSERVATION$COMMAND_NO_OUTPUT")}\n\`\`\``; };