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 53ba9fc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(claude-agent-sdk): record the requested model on a synthetic API-error turn
On an API error the Claude Code CLI yields an assistant message it wrote
itself, with message.model "<synthetic>" (seen live with 0.3.289 and an
unknown model). That turn's LLM span carried gen_ai.request.model and
claude_agent.model "<synthetic>", so Observe listed a model that does not
exist.
The turn now carries the requested model (options.model, else the init
message's model) on both keys, and keeps the CLI's value on the new
claude_agent.message.model. Real model replies are unchanged. The key
lives in TraceAIAttributes, so the Python attribute parity list stays
exact.
Live: unknown model via CLIProxy -> turn model no-such-model-th8103,
claude_agent.message.model "<synthetic>", status ERROR (was model
"<synthetic>").
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: typescript/packages/traceai_claude_agent_sdk/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
@@ -73,7 +73,7 @@ A foreground subagent span ends with its `tool.Agent` / `tool.Task` result. A su
73
73
74
74
| Field | Attributes | Source |
75
75
|---|---|---|
76
-
| Model |`gen_ai.request.model`, `claude_agent.model`|`options.model`, the init message, each assistant message |
76
+
| Model |`gen_ai.request.model`, `claude_agent.model`|`options.model`, the init message, each assistant message. On an API error the CLI yields an assistant message it wrote itself, with model `<synthetic>`: that turn carries the requested model (`options.model`, else the init message's) and `claude_agent.message.model` = `<synthetic>`|
77
77
| Provider |`gen_ai.provider.name` = `anthropic`, or `custom` when `ANTHROPIC_BASE_URL` (from `options.env`, else `process.env`) is not an `anthropic.com` host ||
78
78
| Tokens |`gen_ai.usage.input_tokens`, `output_tokens`, `total_tokens`, `cache_read_tokens`, `cache_creation_tokens`| result `modelUsage` summed over every model, on the conversation span only. See "Usage and cost" |
79
79
| Cost |`claude_agent.cost.total_usd` and `gen_ai.cost.total`| result `total_cost_usd`; never computed here. See "Usage and cost" |
0 commit comments