Area
Proxy and routing
What are you trying to accomplish?
Provide an opt-in / configurable safeguard (blockedModelRedirects) at the shared routing layer to prevent accidental consumption or background helper leakage when an operator explicitly disables a specific model (such as gpt-5.6-terra).
When configured, requests targeting a blocked model are automatically redirected to an operator-specified substitute model (e.g. gpt-5.6-terra → gpt-5.6-luna) across all entry paths (Responses, Chat completions, compaction, search, subagent fallback, combo/concrete routes, and account namespaces) with a distinct routeReason: "blocked-model-redirect".
What prevents this today?
disabledModels only hides models from catalog discovery and GUI/CLI pickers, but does not prevent clients from directly submitting that model ID.
shadowCallIntercept is focused on helper-call replacements in the Responses handler, leaving Chat, compaction, and combo/concrete route paths unintercepted.
- Currently, there is no shared-layer configurable mechanism to safely redirect requests for intentionally disabled/blocked models to an approved replacement.
What should OpenCodex do?
- Support an optional
blockedModelRedirects mapping in OcxConfig (e.g. blockedModelRedirects: { "gpt-5.6-terra": "gpt-5.6-luna" }).
- When configured, the shared routing layer (
routeResult in src/router.ts) redirects incoming requests targeting any matching model to its replacement, assigning routeReason: "blocked-model-redirect" while preserving account namespaces and decision trace transparency.
- When
blockedModelRedirects is omitted or unset (default), all models (including gpt-5.6-terra) route normally as first-class native models without any interception.
Example usage or interface
// config.json
{
"blockedModelRedirects": {
"gpt-5.6-terra": "gpt-5.6-luna"
}
}
// When blockedModelRedirects is configured:
routeModel(config, "gpt-5.6-terra");
// -> { providerName: "openai", modelId: "gpt-5.6-luna", routeKind: "native", routeReason: "blocked-model-redirect" }
routeModel(config, "side/gpt-5.6-terra");
// -> { providerName: "openai", modelId: "gpt-5.6-luna", routeKind: "explicit-account", routeReason: "blocked-model-redirect", codexAccountId: "...", codexAccountNamespace: "side" }
// When blockedModelRedirects is unset (default):
routeModel(config, "gpt-5.6-terra");
// -> { providerName: "openai", modelId: "gpt-5.6-terra", routeKind: "native", routeReason: "native-family" }
Alternatives or workarounds
- Relying only on
disabledModels (leaves direct client submissions and helper paths unprotected).
- Hardcoding a global unconditional rewrite (undesirable, as it breaks normal use for operators who want to use Terra).
Additional context
Opt-in redirection at the shared routing layer (src/router.ts + src/lib/shadow-call.ts) provides a clean, predictable safeguard without mutating global catalog definitions or breaking existing native model contracts.
Checks
Area
Proxy and routing
What are you trying to accomplish?
Provide an opt-in / configurable safeguard (
blockedModelRedirects) at the shared routing layer to prevent accidental consumption or background helper leakage when an operator explicitly disables a specific model (such asgpt-5.6-terra).When configured, requests targeting a blocked model are automatically redirected to an operator-specified substitute model (e.g.
gpt-5.6-terra→gpt-5.6-luna) across all entry paths (Responses, Chat completions, compaction, search, subagent fallback, combo/concrete routes, and account namespaces) with a distinctrouteReason: "blocked-model-redirect".What prevents this today?
disabledModelsonly hides models from catalog discovery and GUI/CLI pickers, but does not prevent clients from directly submitting that model ID.shadowCallInterceptis focused on helper-call replacements in the Responses handler, leaving Chat, compaction, and combo/concrete route paths unintercepted.What should OpenCodex do?
blockedModelRedirectsmapping inOcxConfig(e.g.blockedModelRedirects: { "gpt-5.6-terra": "gpt-5.6-luna" }).routeResultinsrc/router.ts) redirects incoming requests targeting any matching model to its replacement, assigningrouteReason: "blocked-model-redirect"while preserving account namespaces and decision trace transparency.blockedModelRedirectsis omitted or unset (default), all models (includinggpt-5.6-terra) route normally as first-class native models without any interception.Example usage or interface
Alternatives or workarounds
disabledModels(leaves direct client submissions and helper paths unprotected).Additional context
Opt-in redirection at the shared routing layer (
src/router.ts+src/lib/shadow-call.ts) provides a clean, predictable safeguard without mutating global catalog definitions or breaking existing native model contracts.Checks