fix: missing model/cost on <synthetic>, Codex Desktop, and run-recorder sessions - #2
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three separate causes for sessions showing
—for model and cost:<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.Codex Desktop sessions — Model was only extracted from
codex_core::session::turnlog rows. Newer Codex Desktop versions may not log those rows for all sessions, so model stayed null.Codex run-recorder sessions — Only checked
~/.codex/config.tomlfor the model. Didn't tryconfig.yaml/config.ymlor theCODEX_MODELenv var.Leftover
filesfield incodex-watcher.mjs— not removed in v0.5.0 cleanup.Fix
transcript.mjs: skip anymsg.modelthat starts with<— grabs the real model from the next assistant messagecodex-desktop.mjs: extractdata.response.modelfromresponse.completedWebSocket events (already parsed for usage data)run-recorder.mjs: checkCODEX_MODELenv →config.toml→config.yaml→config.ymlin ordercodex-watcher.mjs: removefiles: { read_count: 0, reads: [] }(consistency with other recorders)Existing sessions
Two existing sessions were patched on disk:
<synthetic>session → model corrected toclaude-sonnet-4-6, cost estimatedgpt-5.5from config (cost now estimable via live pricing DB)Codex Desktop sessions with
nullusage (no token data captured at all) can't be recovered — those logs didn't contain parseable response data.🤖 Generated with Claude Code