fix(doctor): normalize stale OpenAI Codex session refs#90662
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 5, 2026, 9:02 AM ET / 13:02 UTC. Summary PR surface: Source +1, Tests +29. Total +30 across 2 files. Reproducibility: yes. from source inspection. On current main, a session entry with canonical Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow doctor-only migration if CI stays green, keeping runtime write-boundary changes out of this PR unless maintainers reopen that separate product decision. Do we have a high-confidence way to reproduce the issue? Yes from source inspection. On current main, a session entry with canonical Is this the best way to solve the issue? Yes. The PR fixes the existing doctor migration helper at the repair boundary, preserves providerless legacy behavior, and avoids reviving the broader runtime write-boundary shim from #90321. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 520992a1defd. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +29. Total +30 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@ooiuuii I merged some single-test PRs yesterday, but please consolidate the rest of your plan on a single PR, we don't usually merge those. |
Summary
This PR tightens the doctor repair path for stale Codex session store state after the OpenAI/Codex provider unification.
modelProvider: "openai"/providerOverride: "openai"but still stores a legacyopenai-codex/...model value, doctor now rewrites the model value to the unscoped OpenAI model id (gpt-*).openai/...so the provider can be inferred later.modelProvider: "openai-codex"still rewrites the provider toopenaiand keeps the model unscoped.This is intentionally doctor/update repair only. It does not reintroduce the closed runtime write-boundary shim from #90321.
Linked context
Related #90319
Related #90321
Real behavior proof (required for external PRs)
modelProvider: "openai"but legacymodel: "openai-codex/gpt-*"was repaired tomodel: "openai/gpt-*", leaving a provider-prefixed model under an already canonical provider. Session resolution treatsmodelProvider+modelas a pair, so the durable repaired state should bemodelProvider: "openai",model: "gpt-*".agent/xiaozhua/codex-session-doctor-normalize, commit0f24e0f9570) using the realrepairCodexSessionStoreRoutesdoctor session repair function.{ "result": { "changed": true, "sessionKeys": [ "staleOpenAIProvider" ] }, "store": { "staleOpenAIProvider": { "sessionId": "s1", "updatedAt": 123, "modelProvider": "openai", "model": "gpt-5.5", "providerOverride": "openai", "modelOverride": "gpt-5.4" } } }modelProvider: "openai",model: "openai-codex/gpt-5.5"shape repaired tomodel: "openai/gpt-5.5", leaving a provider-prefixed model under canonicalmodelProvider: "openai".Tests and validation
Commands run:
Results:
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. Running doctor/update on stale session stores produces cleaner canonical OpenAI session model state.
Did config, environment, or migration behavior change? (
Yes/No)Yes. Doctor session-store repair now normalizes this additional stale session shape.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
Accidentally changing providerless legacy model refs that need a provider prefix for later inference.
How is that risk mitigated?
The new unscoped rewrite applies only when the persisted session provider is already canonical
openai; providerless legacy refs continue to use the existingopenai/...canonical form. Existing fullcodex-route-warningscoverage still passes.Current review state
What is the next action?
Wait for CI and ClawSweeper review.
What is still waiting on author, maintainer, CI, or external proof?
CI/ClawSweeper are pending.
Which bot or reviewer comments were addressed?
None. This follows up on the remaining doctor-session repair gap rather than reviving the closed runtime shim from #90321.