codex - ✅(Solved) Fix Repeated “model metadata not found” warning with gateway model IDs (openai/gpt-5.3-codex) should be deduplicated per session [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#21070Fetched 2026-05-05 05:53:54
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Assignees
Timeline (top)
labeled ×3assigned ×1cross-referenced ×1

Error Message

  • Warn once per session (or once per normalized model key), not every turn.

Fix Action

Fixed

PR fix notes

PR #21090: [codex] Dedupe fallback model metadata warnings

Description (problem / solution / changelog)

Fixes #21070.

This is a small cleanup around model metadata handling for gateway/provider model names. It follows the report and proposed direction from @dkbush by keeping the fallback metadata warning useful without repeating it every turn, and by tightening the existing provider-prefix lookup path.

  • Track fallback metadata warning slugs in session state so each unresolved model warns once per session.
  • Keep warning emission outside the session-state lock and preserve the existing warning text.
  • Allow one-segment provider prefixes with hyphenated provider IDs, while preserving the multi-segment rejection behavior.
  • Add focused coverage for warning dedupe and hyphenated provider-prefix metadata matching.

Testing:

  • Ran just fmt.
  • Ran git diff --check.
  • Added tests for the new warning dedupe and provider-prefix lookup behavior.

Changed files

  • codex-rs/core/src/session/tests.rs (modified, +25/-0)
  • codex-rs/core/src/session/turn_context.rs (modified, +21/-11)
  • codex-rs/core/src/state/session.rs (modified, +2/-0)
  • codex-rs/models-manager/src/manager.rs (modified, +6/-5)
  • codex-rs/models-manager/src/manager_tests.rs (modified, +15/-0)
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

versions after 0.122.0

What subscription do you have?

Enterprise

Which model were you using?

gpt-5-3-codex-public

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

When Codex is configured through a model gateway, the returned model name includes a provider prefix, e.g.:

openai/gpt-5.3-codex

Codex logs a warning that model metadata is not found, and this warning repeats on every prompt/turn.

What steps can reproduce the bug?

Reproduction steps

  1. Use a model gateway that returns provider-prefixed model IDs (example: openai/gpt-5.3-codex).
  2. Configure Codex to use that model.
  3. Set fallback config values (model_reasoning_effort, model_context_window, model_max_output_tokens).
  4. Start Codex and send multiple prompts.
  5. Observe the same metadata warning each turn.

Actual behavior

Repeated warning on each prompt cycle for the same unresolved model ID.

What is the expected behavior?

  • Warn once per session (or once per normalized model key), not every turn.
  • Ideally normalize model IDs from gateway/provider formats before metadata lookup and warning dedupe.

Additional information

Proposed fix

  • Normalize/tokenize gateway model strings before lookup and dedupe.
  • Track warned keys in-session and suppress duplicates.
  • Optional exit summary: “Suppressed N duplicate metadata warnings.”

Why this matters

  • Reduces warning noise.
  • Prevents warning fatigue.
  • Keeps logs useful for actionable problems.
  • Users may already supply explicit fallback metadata.

Related issues

extent analysis

TL;DR

Normalize model IDs from the model gateway before metadata lookup to prevent repeated warnings.

Guidance

  • Verify that the model gateway is returning provider-prefixed model IDs, such as "openai/gpt-5.3-codex", which may be causing the metadata warning.
  • Consider normalizing or tokenizing the gateway model strings before lookup to prevent duplicate warnings.
  • Track warned model IDs in-session to suppress duplicates and reduce warning noise.
  • Review related issues (e.g., #12100, #14757, #12295) for potential insights or fixes.

Example

No code snippet is provided as the issue does not contain sufficient code context.

Notes

The proposed fix involves normalizing model IDs and tracking warned keys in-session, which may require modifications to the Codex configuration or code.

Recommendation

Apply workaround: Normalize model IDs from the model gateway before metadata lookup, as this is a targeted fix for the reported issue and can help reduce warning noise.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING