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:
parent
b007ddffc8
commit
02ed09b77b
2 changed files with 6 additions and 3 deletions
|
|
@ -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),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue