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:
David Rudduck
2026-02-10 16:08:43 +10:00
committed by Peter Steinberger
parent f788de30c8
commit 242f2f1480

View File

@@ -349,7 +349,7 @@ export async function handleToolsInvokeHttpRequest(
sendJson(res, 200, { ok: true, result });
} catch (err) {
logWarn(`tools-invoke: tool execution failed: ${String(err)}`);
sendJson(res, 400, {
sendJson(res, 500, {
ok: false,
error: { type: "tool_error", message: "tool execution failed" },
});