mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 21:01:43 +03:00
fix: return 500 for tool execution failures instead of 400
Tool runtime errors are server-side faults, not client input errors. Returning 400 causes clients to mishandle retries/backoff. Addresses Greptile review feedback on #13185.
This commit is contained in:
committed by
Peter Steinberger
parent
f788de30c8
commit
242f2f1480
@@ -349,7 +349,7 @@ export async function handleToolsInvokeHttpRequest(
|
|||||||
sendJson(res, 200, { ok: true, result });
|
sendJson(res, 200, { ok: true, result });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logWarn(`tools-invoke: tool execution failed: ${String(err)}`);
|
logWarn(`tools-invoke: tool execution failed: ${String(err)}`);
|
||||||
sendJson(res, 400, {
|
sendJson(res, 500, {
|
||||||
ok: false,
|
ok: false,
|
||||||
error: { type: "tool_error", message: "tool execution failed" },
|
error: { type: "tool_error", message: "tool execution failed" },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user