Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

feat: dynamic model instructions and gpt-5.3-codex support#12

Merged
iam-brain merged 32 commits intomainfrom
codex-session-caching
Feb 7, 2026
Merged

feat: dynamic model instructions and gpt-5.3-codex support#12
iam-brain merged 32 commits intomainfrom
codex-session-caching

Conversation

@iam-brain
Copy link
Owner

Summary

  • Implemented dynamic account selection and rate-limit tracking keyed by normalized model slugs, removing reliance on a static ModelFamily list.
  • Added a server-first instruction resolution flow: /codex/models metadata is checked first, followed by a GitHub-based fallback cascade that dynamically maps gpt_*_prompt.md files to model slugs.
  • Added first-class support for gpt-5.3-codex across code, configuration templates, and the testing suite.
  • Updated documentation and personality logic to align with modern model variant handling and the removal of legacy substring-based normalization.

Test Plan

  • Verified all 457 tests pass (npm test).
  • Confirmed build succeeds (npm run build).
  • Audited documentation for consistency across all guides.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

for (const modelId of Object.keys(models)) {
const parsed = parseCodexMetadataModel(modelId);
if (parsed?.effort) {
delete models[modelId];
continue;
}
if (!isAllowedMetadataModel(modelId)) delete models[modelId];

P2 Badge Preserve non-codex variant model entries

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".

@iam-brain
Copy link
Owner Author

@codex audit all updates in the PR

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +116 to +117
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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.
@iam-brain iam-brain merged commit be1249a into main Feb 7, 2026
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant