Repository navigation
[Feature/UX]: streamline context-window presets/import for /models responses without metadata #1760
Description
Area
Catalog / models
What are you trying to accomplish?
I want a quick, reviewable way to supply known context-window values for an OpenAI-compatible relay whose /v1/models response contains model IDs but no context-window metadata. The goal is to populate the existing modelContextWindows fallback without hand-editing JSON for each provider/model, so Codex shows the operator's documented or tested capacity instead of the conservative default.
What prevents this today?
#1073 and the merged PR #1223 already expose and persist contextWindow and modelContextWindows; that solves the underlying configuration mechanism. The remaining problem is discoverability and bulk entry. When live discovery omits context metadata, a newly added relay is shown with the conservative 128K catalog value (about 122K visible in Codex). The operator must know which field to edit and manually update config or open models one by one. There is no clear "metadata not reported" state, reusable preset, or paste/import path.
providerContextCaps is not a substitute: it is a ceiling, while this request is about a user-supplied fallback when the upstream value is unknown.
What should OpenCodex do?
Keep the current contextWindow/modelContextWindows semantics and let the operator choose the value. When /v1/models has no recognized context metadata for one or more rows, provide a non-guessing convenience workflow, for example:
- show an explicit "context window not reported by provider" status and a quick-fill action in the dashboard (and a comparable CLI/config path);
- accept a validated JSON map or config fragment for
modelContextWindows, matched against discovered model IDs, with a preview before saving; - allow saving and reusing a local/provider-scoped preset for newly discovered IDs;
- label the source of the effective value as upstream-reported, user-supplied fallback, or conservative default.
A minimum useful version could be a banner listing the affected model IDs with a paste/import action. Unknown IDs should be shown for review rather than silently dropped. Explicit user values must survive refreshes and remain easy to clear.
OpenCodex should not infer a capacity from a model name or claim what the upstream service supports. Presets should be operator-provided and clearly marked as such.
Example usage or interface
A relay returns only IDs:
{
"data": [
{ "id": "gpt-5.6-sol" },
{ "id": "gpt-5.6-terra" }
]
}The dashboard could show:
Context window metadata was not reported for 2 discovered models.
Import a provider preset or enter a fallback map. Values are user-supplied and are not verified against the upstream service.
Pasting the following map would preview and then write the existing configuration field:
{
"providers": {
"BLT": {
"modelContextWindows": {
"gpt-5.6-sol": 350000,
"gpt-5.6-terra": 350000
}
}
}
}The same flow could accept just the map:
{
"gpt-5.6-sol": 350000,
"gpt-5.6-terra": 350000
}The effective catalog would then use those user-supplied fallbacks while preserving the current behavior for models that report authoritative metadata.
Alternatives or workarounds
- Hand-edit
config.jsonunderproviders.<id>.modelContextWindows; this works but is easy to miss and awkward for several models or repeated provider setup. - Use the context-window fields added by Models GUI cannot define a fallback context window for metadata-poor third-party providers #1073/fix(models): context window controls for metadata-poor providers (#1073) #1223 one model at a time; this is a valid workaround, but does not surface missing metadata or provide bulk import/reuse.
- Add a canonical registry entry; this would be inappropriate for a generic relay unless OpenCodex has primary evidence for the upstream capacity.
Additional context
- Observed with OpenCodex 2.19.0 and a local BLT OpenAI-compatible provider whose
/v1/modelsresponse omitted context metadata. - The manual values above are an operator configuration example, not a claim about BLT or any upstream model contract.
- Related work: Models GUI cannot define a fallback context window for metadata-poor third-party providers #1073, fix(models): context window controls for metadata-poor providers (#1073) #1223, and the earlier #485 discussion. This request is intentionally limited to setup/discoverability/import/preset UX; it does not ask to reimplement the existing manual override mechanism or to guess upstream capabilities.
- No credentials, API keys, or other personal data are included.
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
coderabbitai commentedon Aug 15, 2026
🔗 Related PRs
#889 - fix(providers): Copilot mixed-wire routing, DeepSeek service_tier + reasoning replay, Claude 4.6/4.7 1M windows [open]
#1028 - fix(catalog): routed models never inherit the native template's context window (
#992) [merged]#1203 - feat(models): add context window controls [open]
#1435 - fix(catalog): apply providerContextCaps.openai to native OpenAI rows [merged]
#1535 - fix(providers): keep hand-edited context windows through a POST overwrite [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
lidge-jun commentedon Aug 19, 2026
리뷰 · 우선순위 24 / 80
OpenAI 호환 릴레이의
/v1/models가 ID만 주고 컨텍스트 창 메타데이터를 안 줄 때, 기존modelContextWindows를 손으로 JSON을 하나씩 고치지 않고 넣고 싶다는 UX 요청입니다. #1073 / #1223이 설정 필드는 이미 넣었고, 남은 것은 발견하기 쉽고 한꺼번에 넣는 흐름입니다.roadmap이슈입니다.현재
dev에는contextWindow와modelContextWindows검증이src/server/auth-cors.ts에 있습니다. 값은 양의 정수여야 하고, 캐논 OpenAI 후보에서는 해당 필드를 지웁니다.src/generated/model-metadata.ts는 번들 메타데이터의 창 크기를 들고 있습니다.providerContextCaps는 상한이라, 업스트림이 창을 안 알려줄 때의 사용자 폴백과는 다릅니다.문제는 라이브 디스커버리가 메타데이터를 빼면 보수적인 128K 카탈로그 값이 보이고, "메타데이터 없음" 상태나 붙여넣기/프리셋이 없다는 점입니다. 이슈도 모델 이름으로 용량을 추측하거나 업스트림 계약을 단정하지 말라고 합니다. 값은 운영자가 넣고, 출처를 upstream / user-supplied / conservative default로 구분해야 합니다.
해결방안: 설정 의미를 바꾸지 말고, 대시보드에 영향받는 모델 ID 목록과 JSON 맵 미리보기/저장을 붙이면 됩니다. 맵은 발견된 ID와 맞추고, 모르는 ID는 조용히 버리지 말고 검토하게 두며, 명시 값은 새로고침 뒤에도 남기고 쉽게 지울 수 있어야 합니다. 모델명으로 창을 추론하는 패치는 이 이슈와 맞지 않습니다.
이 댓글은 grok-bot이 작성했습니다
lidge-jun commentedon Aug 19, 2026
지원 경로.
대시보드에 일괄 붙여넣기/프리셋 UX는 안 넣음.
창 크기는
~/.opencodex/config.json에서 넣으면 됨.{ "providers": { "BLT": { "modelContextWindows": { "gpt-5.6-sol": 350000, "gpt-5.6-terra": 350000 } } } }프로바이더 전체에 하나만 쓰려면
contextWindow숫자. 문서:docs-site/src/content/docs/reference/configuration/providers.md. 넣은 뒤ocx sync.이 설정/CLI 쪽은 메인터가 더 강화할 예정임. 이 이슈의 GUI 임포트는 하지 않음. 닫음.
이 댓글은 grok-bot이 작성했습니다