Repository navigation
[Feature] Opt-in blocked model redirection at shared routing layer #2853
Description
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?
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.- 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
blockedModelRedirectsmapping inOcxConfig(e.g.blockedModelRedirects: { "gpt-5.6-terra": "gpt-5.6-luna" }). - When configured, the shared routing layer (
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. - When
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
// 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
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
lidge-jun commentedon Aug 28, 2026
리뷰 · 우선순위 36 / 80
이 이슈는
disabledModels가 피커/디스커버리만 가리고 클라이언트가gpt-5.6-terra를 직접 넣으면 막지 못한다는 점, 그리고shadowCallIntercept가 Responses 헬퍼 가지에 치우쳐 Chat·compact·combo 등이 샌다는 점을 문제로 둡니다. 원하는 동작은 공유 라우터에서 테라를 루나로 하드 인터셉트하고routeReason: "blocked-model-redirect"를 남기는 것입니다. 구현 PR은 #2854입니다.현재
dev에서 테라는 막아야 할 잔재가 아니라 공식 네이티브 모델입니다.DEFAULT_SUBAGENT_MODELS에 들어가 있고, 네이티브 카탈로그·레지스트리·가격·Cursor 디스커버리에도gpt-5.6-terra가 있습니다. 타입/설정 쪽 주석도 sol/terra=v2, luna=v1 같은 역할 구분을 전제로 합니다. 그래서 “실수 방지”와 “테라 전면 폐기”는 다른 요구입니다. 이슈 문구는 전자에 가깝고, 제안된 공유층 hard rewrite는 후자에 가깝습니다. 그 간극을 먼저 메워야 합니다.#2854가 고른
routeResult출구는 커버리지 면에서는 이슈 취지에 맞습니다. 다만 전역 exact 맵은 옵트인이 없고, 콤보/정책은 reason을 다시 덮을 수 있으며, full-slash·terra-pro·서브에이전트 시드 회귀가 빠져 있습니다. 지금dev방향은 #2837 bug-PR zero-remaining이라, 이 enhancement는 버그 큐보다 제품 결정 큐에 가깝습니다. types/config 스플릿에 바로 죽지는 않지만, 테라를 카탈로그에 남긴 채 라우터만 꺾으면 운영 계약이 이중이 됩니다.경로 disabledModels vs hard redirect - 피커 숨김과 요청 강제 rewrite는 다른 계약. 이슈가 둘을 한 해결로 묶으면 의도 사용까지 깨질 수 있음
경로 src/config.ts DEFAULT_SUBAGENT_MODELS - 테라가 기본 서브에이전트 시드에 있어 전역 rewrite와 충돌
경로 src/codex/catalog/native-models.ts / registry - 테라가 1급 카탈로그·와이어 모델로 남아 있음
경로 shadowCallIntercept 범위 - 헬퍼 intercept 확장과 전역 모델 폐기는 다른 설계. 공유 routeResult 강제는 후자
이슈-PR 쌍 #2853/#2854 - draft PR이 전역 강제를 이미 구현. 제품 결정 없이 착지하면 회귀 큼
메인테이너의 판단이 필요한 지점
너의 추천
제품 결정을 먼저 댓글로 고정하세요. 전역 폐기가 아니면 #2854는 범위 축소(옵트인/설정/헬퍼 한정) 전에는 머지하지 말고, 이슈도 needs-design 쪽으로 남겨 두세요. 정말 폐기라면 카탈로그·DEFAULT_SUBAGENT_MODELS·문서까지 한 묶음 작업으로 다시 짜는 게 맞습니다. 지금 bug-PR 캠페인 중에는 이 쌍을 앞줄에 두지 마세요.
이 댓글은 grok-bot이 작성했습니다
terrytan95 commentedon Aug 28, 2026
Thanks for the thorough review and clarification!
To clarify the intent: this is not a proposal to deprecate or globally drop
gpt-5.6-terrafrom OpenCodex.gpt-5.6-terraremains a valid first-class native model with its catalog entries, pricing, and subagent rosters intact.The specific scenario we want to address is:
gpt-5.6-terrain their environment (or wants to protect against accidental/background helper consumption), background helper calls and accidental client submissions should not silently bypass the intent and continue calling Terra.shadowCallIntercept), rather than an unconditional global hard-coded rewrite.I have updated the PR (#2854) to reflect that this is an optional, opt-in mechanism to prevent accidental/helper leakage when Terra is intentionally disabled, keeping normal Terra operation default-intact.
[-][Feature] Hard intercept and redirect gpt-5.6-terra to gpt-5.6-luna at shared routing layer[/-][+][Feature] Opt-in blocked model redirection at shared routing layer[/+]lidge-jun commentedon Aug 29, 2026
Landed via #2854 at db7606f