fix(routing): harden originating reply routing

This commit is contained in:
Peter Steinberger
2026-01-07 05:02:34 +00:00
parent 2a2e327cae
commit 3668388912
12 changed files with 356 additions and 51 deletions

View File

@@ -1,6 +1,5 @@
import { describe, expect, it } from "vitest";
import type { AgentTool } from "@mariozechner/pi-agent-core";
import { describe, expect, it } from "vitest";
import { toToolDefinitions } from "./pi-tool-definition-adapter.js";

View File

@@ -38,7 +38,7 @@ export function toToolDefinitions(tools: AnyAgentTool[]): ToolDefinition[] {
: "";
if (name === "AbortError") throw err;
const message =
err instanceof Error ? err.stack ?? err.message : String(err);
err instanceof Error ? (err.stack ?? err.message) : String(err);
logError(`[tools] ${tool.name} failed: ${message}`);
return jsonResult({
status: "error",