From cd9a3b02cfa13197d9c67eed99df64d1e59eea20 Mon Sep 17 00:00:00 2001 From: Hiep Le <69354317+hieptl@users.noreply.github.com> Date: Wed, 3 Dec 2025 19:55:55 +0700 Subject: [PATCH] feat(frontend): display command in observation block in ui (#11884) --- .../get-observation-content.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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