mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Fix red X when Tavily MCP does not return error (#11227)
Co-authored-by: mamoodi <mamoodiha@gmail.com>
This commit is contained in:
parent
eb616dfae4
commit
8f94b68ea1
@ -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";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user