fix assistant tool result streaming

This commit is contained in:
ajnart committed 2026-08-10 15:24:34 +02:00
1 parent 414f5dfe53
commit c7fd5eceae
6 files changed
+141 -12

No files matched your search

@@ -0,0 +1,9 @@
import { serialize } from "superjson";
/**
* AI SDK model messages only accept JSON-compatible tool results. Homarr's tRPC callers can
* return richer values such as Date, bigint, Map, Set, NaN, and nested undefined values.
* SuperJSON's transport representation normalizes those values without restoring their runtime
* types, keeping subsequent agent steps valid while preserving the useful data.
*/
export const toAssistantToolOutput = (value: unknown) => serialize(value as Parameters<typeof serialize>[0]).json;