mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
Log why a tool call failed in the stdio server's log
A failed call's reason went only to the client, so client logs showed a failure without its cause.
This commit is contained in:
1 parent
e82ab7440d
commit
ae00f009e6
2 files changed
+32
-1
No files matched your search
+5
-1
@@ -54,7 +54,11 @@ async function respond(server, line, log) {
|
||||
}
|
||||
const described = describeRequest(message);
|
||||
if (described) log(described);
|
||||
return server.handle(message);
|
||||
const response = await server.handle(message);
|
||||
// A failed tool call answers the client, not the log; say why here too.
|
||||
if (response?.result?.isError)
|
||||
log(` ${described} failed: ${response.result.content?.[0]?.text}`);
|
||||
return response;
|
||||
}
|
||||
|
||||
/** Read `--api-base <url>` from command-line arguments. */
|
||||
|
||||
Reference in new issue
Block a user