Repository navigation
feat: recover Codex observed model from the session rollout - #5
Merged
Merged
Conversation
Codex's JSON event stream carries no model field, so codex was the only adapter that never set modelObserved and requested-vs-observed attribution could not be reconciled for it. The effective model is recorded on every turn_context line of the session rollout file, so the adapter now looks the rollout up by thread id (CODEX_HOME-aware, date-partition scan newest-first) and reports the last turn's model. Ephemeral runs persist no rollout, so their attribution stays honestly absent rather than echoing the request - callers who need attribution should run codex with a persistent session. Live-verified: a persistent gpt-5.6-sol run reports modelObserved: gpt-5.6-sol. Unit tests cover the rollout-present and rollout-absent paths; 122 pass / 0 fail. Co-Authored-By: Claude Fable 5 <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.
@
Codexs JSON event stream carries no model field, so structured Codex results
previously had no
modelObservedat all. This recovers the effective model fromthe session rollout file, which records it on every
turn_contextline (last onewins), resolved under
CODEX_HOMEor~/.codex.Runs that persist no rollout report no observed model rather than echoing the
requested one, keeping attribution honest for independence checks.
Also releases 0.6.2: README + CHANGELOG entries and synchronized version sources.
Verification
bun run check— 122 pass / 4 skip / 0 fail, build, compiled-CLI package testsnpm pack --dry-run,npm run audit:prod— 0 vulnerabilities🤖 Generated with Claude Code
@