π OpenHands: AI-Driven Development
Fix red X when Tavily MCP does not return error (#11227)
Alex420068f94b68ea1af
diff --git a/frontend/src/components/features/chat/event-content-helpers/get-observation-result.ts b/frontend/src/components/features/chat/event-content-helpers/get-observation-result.tsindex 30504983a0..fbbceb58fa 100644--- a/frontend/src/components/features/chat/event-content-helpers/get-observation-result.ts+++ b/frontend/src/components/features/chat/event-content-helpers/get-observation-result.ts@@ -17,9 +17,19 @@ export const getObservationResult = (event: OpenHandsObservation) => {case "run_ipython":case "read":case "edit":- case "mcp":if (!hasContent || contentIncludesError) return "error";- return "success"; // Content is valid+ return "success";++ case "mcp":+ try {+ const parsed = JSON.parse(event.content);+ if (typeof parsed?.isError === "boolean") {+ return parsed.isError ? "error" : "success";+ }+ } catch {+ return hasContent ? "success" : "error";+ }+ return hasContent ? "success" : "error";default:return "success";}