Skip to content

fix: missing model/cost on <synthetic>, Codex Desktop, and run-recorder sessions - #2

Merged
fjgbue merged 1 commit into
mainfrom
v0.5-bugfixes
May 26, 2026
Merged

fix: missing model/cost on <synthetic>, Codex Desktop, and run-recorder sessions#2
fjgbue merged 1 commit into
mainfrom
v0.5-bugfixes

Conversation

@fjgbue

@fjgbue fjgbue commented May 26, 2026

Copy link
Copy Markdown
Owner

Problem

Three separate causes for sessions showing for model and cost:

  1. <synthetic> model — Claude Code sometimes emits "model":"<synthetic>" in transcript messages (e.g. injected context). The extractor was capturing this as the model name, making cost calculation impossible.

  2. Codex Desktop sessions — Model was only extracted from codex_core::session::turn log rows. Newer Codex Desktop versions may not log those rows for all sessions, so model stayed null.

  3. Codex run-recorder sessions — Only checked ~/.codex/config.toml for the model. Didn't try config.yaml/config.yml or the CODEX_MODEL env var.

  4. Leftover files field in codex-watcher.mjs — not removed in v0.5.0 cleanup.

Fix

  • transcript.mjs: skip any msg.model that starts with < — grabs the real model from the next assistant message
  • codex-desktop.mjs: extract data.response.model from response.completed WebSocket events (already parsed for usage data)
  • run-recorder.mjs: check CODEX_MODEL env → config.tomlconfig.yamlconfig.yml in order
  • codex-watcher.mjs: remove files: { read_count: 0, reads: [] } (consistency with other recorders)

Existing sessions

Two existing sessions were patched on disk:

  • <synthetic> session → model corrected to claude-sonnet-4-6, cost estimated
  • Codex smoke test → model set to gpt-5.5 from config (cost now estimable via live pricing DB)

Codex Desktop sessions with null usage (no token data captured at all) can't be recovered — those logs didn't contain parseable response data.

🤖 Generated with Claude Code

…ssions

- transcript.mjs: skip model values starting with '<' (e.g. <synthetic>)
  so the next real model name in the session is captured instead
- codex-desktop.mjs: extract model from response.completed WebSocket events
  (data.response.model) alongside usage, so sessions that don't log a
  codex_core::session::turn row can still capture the model name
- codex-watcher.mjs: remove leftover `files` field (removed from other
  recorders in v0.5.0)
- run-recorder.mjs: also check config.yaml/config.yml and CODEX_MODEL env
  var when inferring the model for Codex CLI sessions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fjgbue
fjgbue merged commit 553e33d into main May 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant