fix assistant tool result streaming

This commit is contained in:
ajnart committed 2026-08-14 11:32:11 +02:00
1 parent 295eb836bb
commit 474d9968b5
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;