feat: dynamic model instructions and gpt-5.3-codex support#12
feat: dynamic model instructions and gpt-5.3-codex support#12
Conversation
There was a problem hiding this comment.
💡 Codex Review
opencode-openai-codex-multi-auth/index.ts
Lines 283 to 289 in 4806546
The cleanup loop in normalizeProviderModelMetadata deletes every model key that is not a codex slug or in the small legacy allow-list, which unintentionally drops the non-codex variant entries from the legacy config (e.g., gpt-5.2-high, gpt-5.2-low, etc.). Because the legacy config expresses variants as distinct model IDs, removing them here means those variants disappear from the provider metadata and users can no longer select them in OpenCode, even though they are still present in config/opencode-legacy.json. Consider extending the allow-list or normalizing general-purpose variants instead of deleting them.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex audit all updates in the PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db0039678c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
lib/request/helpers/model-map.ts
Outdated
| const GPT_GENERAL_DYNAMIC_REGEX = | ||
| /^(gpt-\d+(?:\.\d+)*)(?:-(?:none|minimal|low|medium|high|xhigh))$/i; | ||
| const LEGACY_DYNAMIC_ALIASES: Record<string, string> = { | ||
| "gpt-5": "gpt-5.1", | ||
| "gpt-5-codex": "gpt-5.1-codex", | ||
| "gpt-5-codex-max": "gpt-5.1-codex-max", | ||
| "gpt-5-codex-mini": "gpt-5.1-codex-mini", | ||
| }; | ||
| /^(gpt-5\.\d+(?:\.\d+)*)(?:-(?:none|low|medium|high|xhigh))$/i; |
There was a problem hiding this comment.
Allow base GPT-5.x slugs in dynamic model map
GPT_GENERAL_DYNAMIC_REGEX requires an effort suffix (e.g., -low) to recognize non‑codex GPT‑5.x models, so a base model slug like gpt-5.3 (no suffix) won’t be recognized by getNormalizedModel. Because transformRequestBody now throws UnknownModelError when getNormalizedModel returns undefined, any new base GPT‑5.x model coming from /codex/models (or user config) without a suffix will be rejected even though it should be valid. This breaks forward compatibility for new general GPT‑5.x releases unless you keep hard‑coding them in MODEL_MAP.
Useful? React with 👍 / 👎.
Match strict fail-closed catalog behavior with reload-safe error classes.
Treat catalog error names as fatal to avoid bypassing validation.
Avoid GitHub fetches in fetch orchestrator specs when the cache is empty.
Seed instruction caches in the same location as module constants.
Summary
ModelFamilylist./codex/modelsmetadata is checked first, followed by a GitHub-based fallback cascade that dynamically mapsgpt_*_prompt.mdfiles to model slugs.gpt-5.3-codexacross code, configuration templates, and the testing suite.Test Plan
npm test).npm run build).