[BUG] transcript usage lines record the requested model id instead of the served one since 2.1.296
What's Wrong?
Transcript usage lines stopped recording the model that actually served the request. On 2.1.296, message.model carries the id the client requested, where 2.1.294/2.1.295 carried the id the API response returned. The served id now appears in no field of the transcript.
For an endpoint that aliases claude model ids (e.g. api.deepseek.com/anthropic, which serves deepseek-v4-pro for requests of claude-opus-5-5), every usage line now records claude-opus-5-5 regardless of what served it. Usage accounting per actually-served model breaks: aliased-endpoint usage merges with real Anthropic usage of the same id and the two can never be separated after the fact, because the ground-truth model id from the API response is written nowhere.
What Should Happen?
The served id stays in the transcript, either by keeping message.model as the served id or by adding a servedModel field beside the new top-level requestedModel.
Error Messages/Logs
Field comparison across versions on usage-bearing lines:
CC 2.1.294: "message": {"model": "deepseek-v4-pro", ...} (requestedModel: absent)
CC 2.1.295: "message": {"model": "deepseek-v4-pro", ...}, "requestedModel": "claude-opus-5-5[1m]"
CC 2.1.296: "message": {"model": "claude-opus-5-5", ...}, "requestedModel": "claude-opus-5-5[1m]"
No key on 2.1.296 usage lines carries a served model id (full key inventory checked).
Steps to Reproduce
- Point Claude Code at an endpoint that aliases claude model ids, e.g.
ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropicwith a deepseek API key. - Run any prompt with the default model.
- Inspect the session JSONL under
~/.claude/projects/...: on 2.1.296 every usage-bearing line hasmessage.model == "claude-opus-5-5", while the deepseek API response'smodelfield (the ground truth) isdeepseek-v4-proand appears nowhere.
Claude Model
Opus (via the aliasing endpoint above)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.295
Claude Code Version
2.1.296 (Claude Code)
Platform
Other (custom Anthropic-compatible endpoint)
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
The flip rode the auto-update 2.1.295 -> 2.1.296 on 2026-10-10T16:41Z. The public changelog has no entry for this change.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗