Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 22 additions & 17 deletions docs-site/src/content/docs/guides/model-ordering.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: Model Ordering
description: How opencodex determines model order in the Codex picker and spawn_agent model overrides.
description: How opencodex determines routed-model order in Codex and Claude pickers and spawn_agent model overrides.
---

The Codex model picker does not preserve the order of provider declarations or model arrays in the
opencodex configuration. Its final order comes from catalog priorities, with a deterministic
alphabetical order for routed models that share the same priority.
Codex does not preserve the order of provider declarations or model arrays in the opencodex
configuration. Its final order comes from catalog priorities, with a deterministic alphabetical
order for routed models that share the same priority. Claude receives the same routed-model order
from its model-discovery response.

## The rule Codex applies

Expand All @@ -23,13 +24,12 @@ priorities `i * N + j`, where `j` is the selector's zero-based position; a route
rows are moved outside those selector groups. Codex still advertises only the first five
picker-visible rows.

The relevant no-selector priorities are:
When `modelPickerOrder` is unset, the relevant no-selector priorities are:

| Catalog entry | Priority | Source |
| --- | ---: | --- |
| `subagentModels[i]` | `i` (`0` through `4`) | The featured rank map in `src/codex/catalog/sync.ts` |
| Other routed models | `5` | Routed entry creation in `src/codex/catalog/sync.ts` |
| Non-featured routed models listed in `modelPickerOrder` | `1000 + i` | Display-only picker rank in `src/codex/catalog/sync.ts` |
| Native GPT slugs by default | `9` | Native entry creation in `src/codex/catalog/sync.ts` |
| Unselected native models while a featured list exists | At least `featured.length + 100` | Native catalog merge in `src/codex/catalog/sync.ts` |

Expand Down Expand Up @@ -66,7 +66,8 @@ only change whether a model is included.

## Effective picker pattern

With no eligible account selectors and a non-empty featured list, the resulting order is:
When `modelPickerOrder` is unset, no eligible account selectors are present, and the featured list
is non-empty, the resulting Codex order is:

1. Models in the exact configured `subagentModels` order, with priorities `0` through `4`.
2. All remaining routed models, ordered alphabetically by provider and then model id, at priority `5`.
Expand Down Expand Up @@ -117,8 +118,8 @@ if it saves the roster. Use at most five configured ids. With account selectors,
choice can expand into multiple selector-qualified catalog rows, so configured choices and
advertised rows are not necessarily one-to-one.

Use `modelPickerOrder` for display-only ordering of routed `<provider>/<model>` rows beyond that
featured block:
Use `modelPickerOrder` for display-only ordering of routed `<provider>/<model>` rows in the Codex
and Claude model pickers:

```json
{
Expand All @@ -130,13 +131,17 @@ featured block:
}
```

The dashboard's **Models** page can write this setting for all currently visible routed models.
Choose **Default** to keep the normal provider/model order, **A–Z** to sort by model id,
**Provider** to group by provider, or **Most used** to rank by all recorded request history. The
dashboard fetches usage only when you apply the Most used order.

Listed routed rows appear in the configured order. A routed row omitted from the array keeps its
normal priority, so it remains ahead of the `modelPickerOrder` display band; list every routed row
whose relative position you want to control. A row also present in `subagentModels` keeps its
featured priority. Bare native and account-qualified native rows are not reordered by
`modelPickerOrder`; use `subagentModels` for those rows.

`modelPickerOrder` never changes the `spawn_agent` candidate set. It changes only the
Codex-visible picker priority while opencodex retains each moved row's natural priority for
sub-agent selection. `disabledModels` and each provider's `selectedModels` remain visibility fields,
not ordering controls. There is no separate `modelOrder`, `providerOrder`, or priority-map setting.
whose relative position you want to control. Native and account-qualified native rows are not
reordered by `modelPickerOrder`.

`modelPickerOrder` never changes the `spawn_agent` candidate set. It changes only harness-visible
picker order while opencodex retains each moved row's natural priority for sub-agent selection.
`disabledModels` and each provider's `selectedModels` remain visibility fields, not ordering
controls. There is no separate `modelOrder`, `providerOrder`, or priority-map setting.
14 changes: 13 additions & 1 deletion gui/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export const de: Record<TKey, string> = {
"models.setAllHint": "Schaltet das Standardfenster {value} für alle gerouteten Anbieter ein. Fehlen context_window / context_length, wird dieser Wert das tatsächliche Codex-Fenster. Für ein einzelnes Modell nutzen Sie «Eigene Fenster» in derselben Zeile. Native Anbieter bleiben unberührt.",
"models.collapseAll": "Alle einklappen",
"models.expandAll": "Alle ausklappen",
"models.orderHint": "Reihenfolge in der Modellauswahl: Subagents-Auswahl (in der festgelegten Reihenfolge) → übrige geroutete Modelle alphabetisch nach Anbieter, dann Modell-ID → native Modelle. Sichtbarkeitsschalter filtern nur; sie ändern diese Reihenfolge nicht.",
"models.orderHint": "Reihenfolge in der Modellauswahl: Gilt für geroutete Modelle in Codex und Claude. Sichtbarkeitsschalter filtern nur; sie ändern diese Reihenfolge nicht.",
"models.custom": "Benutzerdefiniert…",
"models.customApply": "Anwenden",
"models.customPlaceholder": "Tokens (z. B. 420000)",
Expand Down Expand Up @@ -2246,6 +2246,18 @@ export const de: Record<TKey, string> = {
"claudeDesktop.effort.supported": "effort",
"claudeDesktop.effort.displayOnly": "effort (nur Anzeige)",
"sub.settings": "Einstellungen",
"models.pickerOrder.title": "Reihenfolge der Modellauswahl",
"models.pickerOrder.hint": "Steuert die Reihenfolge weitergeleiteter Modelle in den Auswahlen von Codex und Claude.",
"models.pickerOrder.label": "Weitergeleitete Modelle sortieren",
"models.pickerOrder.default": "Standard",
"models.pickerOrder.alphabetical": "A–Z nach Modell",
"models.pickerOrder.provider": "Nach Anbieter",
"models.pickerOrder.mostUsed": "Am häufigsten verwendet",
"models.pickerOrder.custom": "Benutzerdefinierte Reihenfolge (Konfiguration)",
"models.pickerOrder.apply": "Anwenden",
"models.pickerOrder.applying": "Wird angewendet…",
"models.pickerOrder.saved": "Reihenfolge der Modellauswahl gespeichert. Gilt, wenn Codex oder Claude die Modellliste aktualisiert.",
"models.pickerOrder.usageFailed": "Modellnutzung konnte nicht geladen werden",
"sub.sections": "Subagent-Abschnitte",
"sub.delegation.model": "Zuerst aufgerufenes Modell",
"sub.delegation.modelHint": "Das Modell, zu dem Codex zuerst greift, wenn es Arbeit übergibt. Oben steht, wen es überhaupt aufrufen darf; hier wählst du den Ersten davon.",
Expand Down
14 changes: 13 additions & 1 deletion gui/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ export const en = {
"models.setAllHint": "Turn on the {value} default window for every routed provider. Relays that omit context_window / context_length get this as the actual Codex window. Use Custom windows on a provider row to set one model by hand. Native providers are unaffected.",
"models.collapseAll": "Collapse all",
"models.expandAll": "Expand all",
"models.orderHint": "Picker order: Subagents picks (in the selected order) → remaining routed models alphabetically by provider, then model ID → native models. Visibility switches only filter models; they do not change this order.",
"models.orderHint": "Model picker order: applies to routed models in Codex and Claude. Visibility switches only filter models; they do not change this order.",
"models.custom": "Custom…",
"models.customApply": "Apply",
"models.customPlaceholder": "Tokens (e.g. 420000)",
Expand Down Expand Up @@ -623,6 +623,18 @@ export const en = {
"sub.models": "Models",
"sub.search": "Search models (native gpt + routed)…",
"sub.settings": "Settings",
"models.pickerOrder.title": "Model picker order",
"models.pickerOrder.hint": "Controls routed-model order in Codex and Claude pickers.",
"models.pickerOrder.label": "Order routed models",
"models.pickerOrder.default": "Default (provider, then model)",
"models.pickerOrder.alphabetical": "A–Z by model name",
"models.pickerOrder.provider": "Group by provider",
"models.pickerOrder.mostUsed": "Most used",
"models.pickerOrder.custom": "Custom order (config)",
"models.pickerOrder.apply": "Apply",
"models.pickerOrder.applying": "Applying…",
"models.pickerOrder.saved": "Model picker order saved. Applies when Codex or Claude refreshes its model list.",
"models.pickerOrder.usageFailed": "Failed to load model usage",
"sub.sections": "Subagent sections",
"sub.delegation.model": "Model to call first",
"sub.delegation.modelHint": "The model Codex reaches for first when it hands off work. Featured above is the list it may call; this is the one it calls first.",
Expand Down
14 changes: 13 additions & 1 deletion gui/src/i18n/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ export const fr: Record<TKey, string> = {
"models.setAllHint": "Active la fenêtre par défaut {value} pour chaque fournisseur routé. Si un relais omet context_window / context_length, cette valeur devient la fenêtre Codex réelle. Pour un seul modèle, utilisez « Fenêtres perso » sur la même ligne. Les fournisseurs natifs ne sont pas affectés.",
"models.collapseAll": "Tout réduire",
"models.expandAll": "Tout développer",
"models.orderHint": "Ordre du sélecteur : choix des sous-agents (dans l’ordre sélectionné) → autres modèles routés, classés par ordre alphabétique du fournisseur puis par ID de modèle → modèles natifs. Les options de visibilité ne font que filtrer les modèles ; elles ne modifient pas cet ordre.",
"models.orderHint": "Ordre du sélecteur de modèles : s’applique aux modèles routés dans Codex et Claude. Les options de visibilité ne font que filtrer les modèles ; elles ne modifient pas cet ordre.",
"models.custom": "Personnalisé…",
"models.customApply": "Appliquer",
"models.customPlaceholder": "Jetons (p. ex. 420000)",
Expand Down Expand Up @@ -606,6 +606,18 @@ export const fr: Record<TKey, string> = {
"sub.models": "Modèles",
"sub.search": "Rechercher des modèles (gpt natifs + routés)…",
"sub.settings": "Paramètres",
"models.pickerOrder.title": "Ordre du sélecteur de modèles",
"models.pickerOrder.hint": "Contrôle l’ordre des modèles routés dans les sélecteurs Codex et Claude.",
"models.pickerOrder.label": "Trier les modèles routés",
"models.pickerOrder.default": "Par défaut",
"models.pickerOrder.alphabetical": "A–Z par modèle",
"models.pickerOrder.provider": "Par fournisseur",
"models.pickerOrder.mostUsed": "Les plus utilisés",
"models.pickerOrder.custom": "Ordre personnalisé (configuration)",
"models.pickerOrder.apply": "Appliquer",
"models.pickerOrder.applying": "Application…",
"models.pickerOrder.saved": "Ordre du sélecteur de modèles enregistré. S’applique lorsque Codex ou Claude actualise sa liste de modèles.",
"models.pickerOrder.usageFailed": "Échec du chargement de l'utilisation des modèles",
"sub.sections": "Sections des sous-agents",
"sub.delegation.model": "Modèle à appeler en premier",
"sub.delegation.modelHint": "Le modèle que Codex sollicite en premier lorsqu’il délègue une tâche. La liste À la une ci-dessus contient les modèles qu’il peut appeler ; celui-ci est appelé en premier.",
Expand Down
14 changes: 13 additions & 1 deletion gui/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export const ja: Record<TKey, string> = {
"models.setAllHint": "すべてのルーティング済みプロバイダーに {value} のデフォルトウィンドウをオンにします。中継が context_window / context_length を返さない場合、この値が実際の Codex ウィンドウになります。1 モデルだけ手で書くときは同じ行の「カスタムウィンドウ」を使います。ネイティブプロバイダーには影響しません。",
"models.collapseAll": "すべて折りたたむ",
"models.expandAll": "すべて展開",
"models.orderHint": "ピッカーの順序: サブエージェントの選択(選択順) → 残りのルーティングモデルはプロバイダー別、次にモデル ID 別のアルファベット順 → ネイティブモデル。表示切り替えはモデルをフィルタするだけで、この順序は変更しません。",
"models.orderHint": "モデルピッカーの順序: Codex と Claude のルーティングモデルに適用されます。表示切り替えはモデルをフィルタするだけで、この順序は変更しません。",
"models.custom": "カスタム…",
"models.customApply": "適用",
"models.customPlaceholder": "トークン (例: 420000)",
Expand Down Expand Up @@ -2267,6 +2267,18 @@ export const ja: Record<TKey, string> = {
"pws.tokenInput": "Input",
"pws.tokenOutput": "Output",
"sub.settings": "設定",
"models.pickerOrder.title": "モデルピッカーの順序",
"models.pickerOrder.hint": "Codex と Claude のピッカーにあるルーティング済みモデルの順序を制御します。",
"models.pickerOrder.label": "ルーティング済みモデルの順序",
"models.pickerOrder.default": "デフォルト",
"models.pickerOrder.alphabetical": "モデル名で A–Z",
"models.pickerOrder.provider": "プロバイダー別",
"models.pickerOrder.mostUsed": "使用頻度順",
"models.pickerOrder.custom": "カスタム順序(設定)",
"models.pickerOrder.apply": "適用",
"models.pickerOrder.applying": "適用中…",
"models.pickerOrder.saved": "モデルピッカーの順序を保存しました。Codex または Claude がモデル一覧を更新すると適用されます。",
"models.pickerOrder.usageFailed": "モデル使用状況を読み込めませんでした",
"sub.sections": "サブエージェントのセクション",
"sub.delegation.model": "最初に呼ぶモデル",
"sub.delegation.modelHint": "Codex が作業を任せるとき、最初に呼ぶモデルです。上のおすすめが呼べる候補で、ここで選んだものがその中の第一候補になります。",
Expand Down
14 changes: 13 additions & 1 deletion gui/src/i18n/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ export const ko: Record<TKey, string> = {
"models.setAllHint": "라우팅된 모든 프로바이더에 {value} 기본 창을 켭니다. 중계가 context_window / context_length 를 주지 않으면 이 값이 실제 Codex 창이 됩니다. 모델 하나만 손으로 쓰려면 같은 줄의 「사용자 지정 창」을 쓰세요. 네이티브 프로바이더는 영향을 받지 않습니다.",
"models.collapseAll": "모두 접기",
"models.expandAll": "모두 펼치기",
"models.orderHint": "피커 순서: Subagents에서 지정한 순서 → 나머지 라우팅 모델(프로바이더, 모델 ID 순 알파벳 정렬) → 네이티브 모델. 노출 토글은 모델을 필터링할 뿐 이 순서를 바꾸지 않습니다.",
"models.orderHint": "모델 피커 순서: Codex와 Claude의 라우팅 모델에 적용됩니다. 노출 토글은 모델을 필터링할 뿐 이 순서를 바꾸지 않습니다.",
"models.custom": "직접 입력…",
"models.customApply": "적용",
"models.customPlaceholder": "토큰 (예: 420000)",
Expand Down Expand Up @@ -609,6 +609,18 @@ export const ko: Record<TKey, string> = {
"sub.models": "모델",
"sub.search": "모델 검색(네이티브 gpt + 라우팅)…",
"sub.settings": "설정",
"models.pickerOrder.title": "모델 선택기 순서",
"models.pickerOrder.hint": "Codex와 Claude 선택기에서 라우팅된 모델 순서를 제어합니다.",
"models.pickerOrder.label": "라우팅된 모델 순서",
"models.pickerOrder.default": "기본값",
"models.pickerOrder.alphabetical": "모델별 A–Z",
"models.pickerOrder.provider": "공급자별",
"models.pickerOrder.mostUsed": "가장 많이 사용됨",
"models.pickerOrder.custom": "사용자 지정 순서(구성)",
"models.pickerOrder.apply": "적용",
"models.pickerOrder.applying": "적용 중…",
"models.pickerOrder.saved": "모델 선택기 순서를 저장했습니다. Codex 또는 Claude가 모델 목록을 새로 고치면 적용됩니다.",
"models.pickerOrder.usageFailed": "모델 사용량을 불러오지 못했습니다",
"sub.sections": "서브에이전트 구역",
"sub.delegation.model": "먼저 부를 모델",
"sub.delegation.modelHint": "Codex가 일을 나눠 맡길 때 가장 먼저 부를 모델입니다. 위 추천 목록이 부를 수 있는 후보라면, 여기서 고른 모델이 그중 1순위가 됩니다.",
Expand Down
14 changes: 13 additions & 1 deletion gui/src/i18n/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ export const ru: Record<TKey, string> = {
"models.setAllHint": "Включает окно по умолчанию {value} для всех маршрутизируемых провайдеров. Если релей не отдаёт context_window / context_length, это значение становится реальным окном Codex. Чтобы задать одну модель вручную, используйте «Пользовательские окна» в той же строке. Нативные провайдеры не затрагиваются.",
"models.collapseAll": "Свернуть все",
"models.expandAll": "Развернуть все",
"models.orderHint": "Порядок в селекторе: модели, выбранные на странице «Подагенты» (в заданном порядке) → остальные маршрутизируемые модели по алфавиту — сначала по провайдеру, затем по ID модели → нативные модели. Переключатели видимости лишь фильтруют модели и не меняют этот порядок.",
"models.orderHint": "Порядок в селекторе моделей: применяется к маршрутизируемым моделям в Codex и Claude. Переключатели видимости лишь фильтруют модели и не меняют этот порядок.",
"models.custom": "Другое…",
"models.customApply": "Применить",
"models.customPlaceholder": "Токены (напр. 420000)",
Expand Down Expand Up @@ -2267,6 +2267,18 @@ export const ru: Record<TKey, string> = {
"cws.err.invalidWeight": "Каждый вес round-robin должен быть целым числом от 1 до 10000.",
"cws.err.noEnabledTarget": "Хотя бы одна цель должна использовать включённого провайдера.",
"sub.settings": "Настройки",
"models.pickerOrder.title": "Порядок выбора моделей",
"models.pickerOrder.hint": "Управляет порядком маршрутизируемых моделей в селекторах Codex и Claude.",
"models.pickerOrder.label": "Сортировать маршрутизируемые модели",
"models.pickerOrder.default": "По умолчанию",
"models.pickerOrder.alphabetical": "A–Z по модели",
"models.pickerOrder.provider": "По провайдеру",
"models.pickerOrder.mostUsed": "Чаще всего используемые",
"models.pickerOrder.custom": "Пользовательский порядок (конфигурация)",
"models.pickerOrder.apply": "Применить",
"models.pickerOrder.applying": "Применение…",
"models.pickerOrder.saved": "Порядок выбора моделей сохранён. Применяется, когда Codex или Claude обновляет список моделей.",
"models.pickerOrder.usageFailed": "Не удалось загрузить использование моделей",
"sub.sections": "Разделы подагентов",
"sub.delegation.model": "Модель, которую вызывать первой",
"sub.delegation.modelHint": "Модель, к которой Codex обращается первой, когда передаёт работу. Список выше — кого он вообще может вызвать, а здесь выбирается первый в очереди.",
Expand Down
Loading
Loading