mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 20:45:37 +02:00
fix(tools): use boolean error flag in web_fetch and web_search error responses
Return error: true (boolean) with code field instead of error: "string_code" to match ToolErrorPayload convention. Also update runner.ts formatRunLogToolSummary to prefer details.code for error categorization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -343,12 +343,14 @@ export function createWebFetchTool(): AgentTool<typeof WebFetchSchema, unknown>
|
||||
} catch (error) {
|
||||
if (error instanceof SsrfBlockedError) {
|
||||
return jsonResult({
|
||||
error: "ssrf_blocked",
|
||||
error: true,
|
||||
code: "ssrf_blocked",
|
||||
message: error.message,
|
||||
});
|
||||
}
|
||||
return jsonResult({
|
||||
error: "fetch_failed",
|
||||
error: true,
|
||||
code: "fetch_failed",
|
||||
message: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -135,7 +135,8 @@ export function createWebSearchTool(): AgentTool<typeof WebSearchSchema, unknown
|
||||
return jsonResult(result);
|
||||
} catch (error) {
|
||||
return jsonResult({
|
||||
error: "search_failed",
|
||||
error: true,
|
||||
code: "search_failed",
|
||||
message: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user