[BUG] transcript usage lines record the requested model id instead of the served one since 2.1.296

Status Closed — not planned
Reported on v2.1.296
Maintainer reply None cached
Activity 1 comment · opened Oct 12, 2026 · closed Oct 13, 2026

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

  1. Point Claude Code at an endpoint that aliases claude model ids, e.g. ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic with a deepseek API key.
  2. Run any prompt with the default model.
  3. Inspect the session JSONL under ~/.claude/projects/...: on 2.1.296 every usage-bearing line has message.model == "claude-opus-5-5", while the deepseek API response's model field (the ground truth) is deepseek-v4-pro and 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗