You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 175fb97
Browse filesBrowse the repository at this point in the historyBrowse files
fix(examples): mark a single-call TanStack AI chat root as CHAIN
The recipe gave the chat() root a kind only when it ran more than one
model call. fi-collector stores a span without a kind as observation type
"unknown", so every plain chat() (one model call, no tool round) and every
failed first call showed an "unknown" root in Observe (live run: `[unknown]
chat no-such-model-th8103`). The root is now AGENT with more than one model
call and CHAIN otherwise.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: typescript/examples/tanstack-ai/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ test runs this snippet as written.
129
129
130
130
| Span | Name | Kind set by the recipe | Key attributes |
131
131
|---|---|---|---|
132
-
| chat() call | `chat <model>` | `AGENT` when it ran more than one model call, else none | `gen_ai.request.model`, `tanstack.ai.iterations`, and TanStack's sum of every model call's usage, renamed: each `gen_ai.usage.<suffix>` becomes `tanstack.ai.root_usage.<suffix>` and each `gen_ai.cost.<suffix>` becomes `tanstack.ai.root_usage.cost.<suffix>`. Future AGI sums `gen_ai.usage.*` over the trace, so the root's copy would double tokens, cache, reasoning and cost. The root keeps `gen_ai.usage.*` only when no model call reported usage. |
132
+
| chat() call | `chat <model>` | `AGENT` when it ran more than one model call, else `CHAIN` (a root without a kind shows as type "unknown" in Future AGI) | `gen_ai.request.model`, `tanstack.ai.iterations`, and TanStack's sum of every model call's usage, renamed: each `gen_ai.usage.<suffix>` becomes `tanstack.ai.root_usage.<suffix>` and each `gen_ai.cost.<suffix>` becomes `tanstack.ai.root_usage.cost.<suffix>`. Future AGI sums `gen_ai.usage.*` over the trace, so the root's copy would double tokens, cache, reasoning and cost. The root keeps `gen_ai.usage.*` only when no model call reported usage. |
0 commit comments