Skip to content

Commit 87e874d

Browse files
committed
fix(responses): gate service tiers by provider capability
1 parent 48d59a8 commit 87e874d

18 files changed

Lines changed: 268 additions & 21 deletions

File tree

docs-site/src/content/docs/guides/codex-app-models.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@ fast_mode = true
120120
```
121121

122122
But the model catalog and runtime request tier id use `priority`. opencodex preserves that split.
123-
Native OpenAI passthrough models keep fast support; routed non-OpenAI models strip service-tier
124-
metadata so the fast option is not advertised where it cannot be honored.
123+
Native OpenAI passthrough models keep fast support. Responses providers only receive proxy-generated
124+
OpenAI-specific `service_tier` when their registry capability explicitly opts in; an omitted
125+
capability fails closed — a caller-supplied value is stripped and fastMode never injects one.
126+
DeepSeek V4 Flash's and Volcengine Agent Plan's native Responses routes are explicitly marked
127+
unsupported, so the field stays out of their upstream requests.
125128

126129
## Subagent selection
127130

docs-site/src/content/docs/ja/guides/codex-app-models.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ fast_mode = true
8787
```
8888

8989
ただし、モデル カタログとランタイム リクエスト層 ID は `priority` を使用します。 opencodex はその分割を保持します。ネイティブ OpenAI パススルー モデルは高速サポートを維持します。ルーティングされた非 OpenAI モデルはサービス層メタデータを削除するため、高速オプションが受け入れられない場合はアドバタイズされません。
90+
ネイティブ OpenAI パススルー モデルは fast をサポートします。Responses provider は registry capability が明示的に許可する場合だけ proxy が生成した OpenAI 固有の `service_tier` を受け取ります。capability を省略すると fail-closed となり、呼び出し側の値は削除され、fastMode は注入しません。DeepSeek V4 Flash と Volcengine Agent Plan のネイティブ Responses ルートは明示的に未対応とされるため、このフィールドは上流に送られません。
9091

9192
## サブエージェントの選択
9293

docs-site/src/content/docs/ja/reference/configuration/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ description: プロバイダー エントリ、認証、エンドポイント、
4141
| `adapter` | `string` | `openai-chat``openai-responses``anthropic``google``kiro``cursor``azure-openai` (または別名 `azure`) のいずれか。 |
4242
| `baseUrl` | `string` |アップストリーム API のベース URL。ほとんどの組み込み固定エンドポイントは不一致を無視します。衝突安全キー プリセットは、古い同じ名前のカスタム宛先を保持します。 |
4343
| `responsesPath?` | `string` |キー認証 `openai-responses` リクエストの相対リソース パス。 `/` で始まり、スキーム、クエリ、またはフラグメントが含まれていない必要があります。 |
44+
| `supportsServiceTier?` | `boolean` | Responses の tier 能力。`true` は proxy の `fastMode` による OpenAI `service_tier` の設定/削除、`false` は未対応 upstream への送信前削除、未設定は fail-closed(呼び出し側の値を削除し、`fastMode` は注入しない)を意味します。registry preset が補完するため、custom provider は上流仕様で確認できる場合だけ `true` にしてください。 |
4445
| `disabled?` | `boolean` |プロバイダーをディスク上に保持しますが、ルーティングおよびモデル/カタログのリストからは除外します。 |
4546
| `apiKey?` | `string` | API キー、またはリクエスト時に解決される `${ENV_VAR}` / `$ENV_VAR` 参照。 |
4647
| `apiKeyTransport?` | `"x-api-key" \| "bearer"` | Anthropic キーのヘッダー スタイル。デフォルトはネイティブ `x-api-key` です。キー認証 `anthropic` プロバイダーにのみ有効です。 |

docs-site/src/content/docs/ko/guides/codex-app-models.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,11 @@ fast_mode = true
118118
```
119119

120120
하지만 모델 카탈로그와 런타임 요청 tier id는 `priority`를 씁니다. opencodex는 이 분리를 그대로
121-
유지합니다. 네이티브 OpenAI passthrough 모델은 fast 지원을 유지하고, 라우팅된 비 OpenAI 모델에서는
122-
service-tier 메타데이터를 지워 fast 옵션이 처리 불가능한 곳에서는 노출되지 않게 합니다.
121+
유지합니다. 네이티브 OpenAI passthrough 모델은 fast 지원을 유지합니다. Responses provider는
122+
registry capability가 명시적으로 허용할 때만 proxy가 생성한 OpenAI 전용 `service_tier`를 받습니다.
123+
capability를 생략하면 fail-closed로 호출자 값도 삭제되고 fastMode가 주입되지 않습니다. DeepSeek
124+
V4 Flash와 Volcengine Agent Plan의 네이티브 Responses 라우트는 명시적으로 미지원으로 표시되어 이
125+
필드를 업스트림으로 보내지 않습니다.
123126

124127
## 서브에이전트 선택
125128

docs-site/src/content/docs/ko/reference/configuration/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ description: 공급자 항목, 인증, 엔드포인트, 모델 카탈로그, 할
4141
| `adapter` | `string` | `openai-chat`, `openai-responses`, `anthropic`, `google`, `kiro`, `cursor`, `azure-openai` 중 하나이며, `azure`는 별칭입니다. |
4242
| `baseUrl` | `string` | 상위 API 기본 URL입니다. 대부분의 내장 고정 엔드포인트는 불일치를 무시합니다. 충돌 안전 키 프리셋은 같은 이름의 이전 사용자 지정 목적지를 보존합니다. |
4343
| `responsesPath?` | `string` | 키 인증 `openai-responses` 요청의 상대 리소스 경로입니다. 반드시 `/`로 시작해야 하며 스킴, query, fragment를 포함하면 안 됩니다. |
44+
| `supportsServiceTier?` | `boolean` | Responses tier capability입니다. `true`는 proxy `fastMode`가 OpenAI `service_tier`를 설정/삭제하게 하고, `false`는 지원하지 않는 업스트림으로 보내기 전에 삭제하며, 생략하면 fail-closed로 호출자 값도 삭제하고 `fastMode`가 주입하지 않습니다. registry preset이 보완하므로 custom provider는 업스트림 문서에서 확인된 경우에만 `true`로 설정하세요. |
4445
| `disabled?` | `boolean` | 공급자를 디스크에는 남기되, 라우팅과 모델/카탈로그 목록에서는 제외합니다. |
4546
| `apiKey?` | `string` | API 키 또는 요청 시점에 해석되는 `${ENV_VAR}` / `$ENV_VAR` 참조입니다. |
4647
| `apiKeyTransport?` | `"x-api-key" \| "bearer"` | Anthropic 키 헤더 형식입니다. 기본값은 네이티브 `x-api-key`이며, 키 인증 `anthropic` 공급자에만 유효합니다. |

docs-site/src/content/docs/reference/configuration/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ differing backup and rewrites known legacy namespaced selected ids to bare ids.
5252
| `adapter` | `string` | One of `openai-chat`, `openai-responses`, `anthropic`, `google`, `kiro`, `cursor`, `azure-openai` (or alias `azure`). |
5353
| `baseUrl` | `string` | Upstream API base URL. Most built-in fixed endpoints ignore a mismatch; collision-safe key presets preserve an older same-named custom destination. |
5454
| `responsesPath?` | `string` | Relative resource path for key-auth `openai-responses` requests. It must start with `/` and contain no scheme, query, or fragment. |
55+
| `supportsServiceTier?` | `boolean` | Responses service-tier capability: `true` lets proxy `fastMode` set/remove OpenAI's fast/priority `service_tier`; `false` strips the field for an upstream that rejects it; omitted fails closed — a caller-supplied value is stripped and `fastMode` never injects one. Registry presets backfill this capability; custom providers should set `true` only when the upstream documents `service_tier`. |
5556
| `disabled?` | `boolean` | Keep the provider on disk but exclude it from routing and model/catalog listings. |
5657
| `apiKey?` | `string` | API key, or an `${ENV_VAR}` / `$ENV_VAR` reference resolved at request time. |
5758
| `apiKeyTransport?` | `"x-api-key" \| "bearer"` | Anthropic key header style. Defaults to native `x-api-key`; valid only for key-auth `anthropic` providers. |

docs-site/src/content/docs/ru/guides/codex-app-models.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ fast_mode = true
124124
```
125125

126126
Но каталог моделей и id tier'а во время выполнения используют `priority`. opencodex сохраняет это
127-
разделение. Нативные passthrough-модели OpenAI сохраняют поддержку fast; routed не-OpenAI модели
128-
теряют service-tier metadata, чтобы опция fast не рекламировалась там, где её нельзя выполнить.
127+
разделение. Нативные passthrough-модели OpenAI сохраняют поддержку fast. Responses-провайдеры
128+
получают созданное proxy поле `service_tier` только при явном разрешении registry capability; при
129+
отсутствии capability применяется fail-closed — значение вызывающей стороны удаляется, а fastMode
130+
ничего не инъецирует. Нативные Responses-маршруты DeepSeek V4 Flash и Volcengine Agent Plan явно
131+
помечены как неподдерживающие поле, поэтому оно не отправляется на их upstream.
129132

130133
## Выбор подагентов
131134

docs-site/src/content/docs/ru/reference/configuration/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ cross-route credential fallback не существует. Строки API GPT-
5757
| `adapter` | `string` | Один из `openai-chat`, `openai-responses`, `anthropic`, `google`, `kiro`, `cursor`, `azure-openai` (или alias `azure`). |
5858
| `baseUrl` | `string` | Базовый URL API upstream'а. Большинство built-in fixed-endpoint'ов игнорируют несовпадение; collision-safe key-preset'ы сохраняют старый custom destination с тем же именем. |
5959
| `responsesPath?` | `string` | Relative resource path для key-auth запросов `openai-responses`. Должен начинаться с `/` и не может содержать scheme, query или fragment. |
60+
| `supportsServiceTier?` | `boolean` | Capability уровня Responses: `true` разрешает proxy `fastMode` устанавливать/удалять OpenAI `service_tier`; `false` удаляет поле перед отправкой upstream, который его не поддерживает; отсутствие значения означает fail-closed — значение вызывающей стороны удаляется, а `fastMode` ничего не инъецирует. Registry preset дополняет capability; для custom provider задавайте `true` только при подтверждении в документации upstream. |
6061
| `disabled?` | `boolean` | Сохранить провайдера на диске, но исключить его из routing'а и из model/catalog-listing'ов. |
6162
| `apiKey?` | `string` | API-key либо ссылка `${ENV_VAR}` / `$ENV_VAR`, разрешаемая при каждом запросе. |
6263
| `apiKeyTransport?` | `"x-api-key" \| "bearer"` | Header-style для ключа Anthropic. По умолчанию нативный `x-api-key`; допустим только для key-auth-провайдеров `anthropic`. |

docs-site/src/content/docs/zh-cn/guides/codex-app-models.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ fast_mode = true
8484
```
8585

8686
但模型目录和运行时请求里的 tier id 使用的是 `priority`。opencodex 保留了这个拆分。原生 OpenAI 透传模型保留 fast 支持;路由到非 OpenAI 模型时会移除 service-tier 元数据,因此无法兑现的 fast 选项不会被展示出来。
87+
原生 OpenAI 透传模型保留 fast 支持。只有 registry capability 明确允许时,Responses provider 才会收到 proxy 注入的 OpenAI 专用 `service_tier`;省略 capability 时 fail-closed——调用方已有值会被移除,且 fastMode 不会注入。DeepSeek V4 Flash 与 Volcengine Agent Plan 的原生 Responses 路由被明确标记为不支持该字段,因此不会把它发送给上游。
8788

8889
## 子代理选择
8990

docs-site/src/content/docs/zh-cn/reference/configuration/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ description: 提供者条目、身份验证、端点、模型目录、配额、
4141
| `adapter` | `string` | `openai-chat``openai-responses``anthropic``google``kiro``cursor``azure-openai`(或别名 `azure`)之一。 |
4242
| `baseUrl` | `string` | 上游 API 基础 URL。大多数内置固定端点会忽略不匹配的值;具备冲突安全键的预设会保留一个更早、同名的自定义目标。 |
4343
| `responsesPath?` | `string` | 用于 key-auth `openai-responses` 请求的相对资源路径。必须以 `/` 开头,且不能包含 scheme、query 或 fragment。 |
44+
| `supportsServiceTier?` | `boolean` | Responses 的 service-tier 能力:`true` 允许 proxy 的 `fastMode` 设置/移除 OpenAI fast/priority 的 `service_tier``false` 会为拒绝该字段的上游移除它;省略时 fail-closed —— 移除调用方已有值,且不让 `fastMode` 注入。registry preset 会回填此能力;自定义 provider 只有在上游文档明确支持时才应设为 `true`|
4445
| `disabled?` | `boolean` | 将提供者保留在磁盘上,但从路由和模型/目录列表中排除。 |
4546
| `apiKey?` | `string` | API key,或在请求时解析的 `${ENV_VAR}` / `$ENV_VAR` 引用。 |
4647
| `apiKeyTransport?` | `"x-api-key" \| "bearer"` | Anthropic key 头部样式。默认使用原生 `x-api-key`;仅对 key-auth `anthropic` 提供者有效。 |

0 commit comments

Comments
 (0)