fix(llmobs): format AI SDK rich tool results#9399
Conversation
Overall package sizeSelf size: 7.48 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.2 | 124.41 kB | 440.65 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2026-07-21 01:30:52 Comparing candidate commit d91d6d8 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2321 metrics, 37 unstable metrics.
|
|
| } | ||
|
|
||
| /** | ||
| * @param {unknown} value |
There was a problem hiding this comment.
nit - we could probably better define this type at least with the knowledge we have below on the properties we access from each part
There was a problem hiding this comment.
i would prefer we just write new tests in the existing test file for a more "end-to-end" testing experience. especially since the underlying utilities are also relying on object shapes from the actual ai sdk
aaa217b to
aab8927
Compare
AI SDK tool outputs can contain multipart content and error variants. Preserve text, replace file and image payloads with safe summaries, and fall back without throwing on malformed values. Fixes: #9395
AI SDK 7 emits generic file and provider-reference parts that were reported as unparsable. Model the supported output shapes locally and exercise content outputs through both telemetry paths so SDK shape changes fail on the user path.
Adding toModelOutput changed the second provider request without a matching cassette, so every AI SDK v5-v7 matrix forwarded to OpenAI with the fake key. Keep the recorded workflow payload stable while formatter coverage pins the rich result shapes and schema precedence.
aab8927 to
d91d6d8
Compare
Summary
AI SDK multipart and error tool outputs were treated as unparsable. This preserves text, emits metadata-free summaries for rich file and image parts, and keeps malformed or circular telemetry inputs from throwing.
Fixes: #9395