fix(agent): call api v1 via loopback instead of public url
CI / checks (push) Has been cancelled

Tool self-fetches were hairpinning to fam.ginnoir.com and failing,
so list_calendars/create_event returned 500 and the model gave up.
This commit is contained in:
ginnoir
2026-07-09 00:38:33 -05:00
parent 60eb101015
commit 3e8fe2d06d
4 changed files with 123 additions and 16 deletions
+13 -1
View File
@@ -160,8 +160,20 @@ export async function runAgentChat(options: {
try {
result = await executeTool(toolCall.function.name, toolCall.function.arguments);
const parsed = JSON.parse(result) as { status?: number };
const parsed = JSON.parse(result) as { status?: number; body?: unknown };
status = typeof parsed.status === "number" ? parsed.status : 200;
if (status >= 400) {
logger.warn(
{
msg: "agent.chat.tool_error",
round,
name: toolCall.function.name,
status,
body: parsed.body,
},
"agent tool returned error",
);
}
} catch (err) {
status = 500;
result = JSON.stringify({