You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(effort-cap): hard reasoning-effort ceiling for main and sub-agent turns
Add effortCap and subagentEffortCap config options that enforce a per-request
hard ceiling on reasoning effort at the proxy layer. This closes the gap where
codex-rs inherits the parent's ultra-tier default on bare spawns regardless of
injection-side advisory effort.
- src/server/effort-policy.ts: sub-agent request detection from codex-rs
spawn markers (x-openai-subagent, x-codex-turn-metadata), cap resolution
against the model's supported effort ladder, dual-shape rewrite (parsed
options + raw body) that runs before the native effort clamp
- src/server/responses.ts: effort cap enforcement hook before mock-max clamp
- src/server/management-api.ts: GET/PUT /api/effort-caps endpoints
- src/types.ts: effortCap, subagentEffortCap on OcxConfig
- src/reasoning-effort.ts: codexEffortRank helper
- src/adapters/openai-responses.ts: forward x-openai-subagent header
- gui: dashboard effort cap selectors with i18n (en/de/ko/zh)
- docs: configuration reference (en/ko/zh)
- tests: 32 tests covering classification, resolution, rewrite, and API
Copy file name to clipboardExpand all lines: docs-site/src/content/docs/ko/reference/configuration.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ opencodex는 `~/.opencodex/config.json`에서 설정을 읽습니다. `ocx init`
20
20
|`subagentModels?`|`string[]`|`gpt-5.5`, GPT-5.6 3종, `gpt-5.4-mini`| Codex 서브에이전트 선택기 앞쪽에 표시할 네이티브 slug 또는 `provider/model` id. 최대 5개이며, 명시적인 빈 배열도 그대로 보존합니다. v2 위임 안내에는 사용 가능한 모델 로스터로도 주입되며, 각 항목이 카탈로그에 광고하는 effort 사다리가 함께 표기됩니다. |
21
21
|`injectionModel?`|`string`| — | 주입되는 multi-agent 안내(v2 표면)에 들어갈 네이티브/라우팅 모델. 위임 안내에서 이 모델을 `fork_turns: "none"`과 함께 `spawn_agent`에 넘기게 합니다. |
22
22
|`injectionEffort?`|`string`| — | 선호하는 `spawn_agent` reasoning effort(`low`부터 `ultra`). `injectionModel`과 함께 쓸 때만 의미가 있습니다. |
23
+
|`effortCap?`|`string`| — | 프록시를 거치는 모든 턴(메인 에이전트와 서브에이전트)의 reasoning effort에 요청별로 적용하는 강제 상한입니다. `low`부터 `ultra`까지 허용하며 값을 높이지 않고 낮추기만 합니다. 상한 이하에서 모델이 지원하는 가장 높은 단계로 내립니다. 모델이 effort 제어를 노출하지 않거나 상한 이하에 지원 단계가 없으면 effort 필드를 제거하고 프로바이더 기본값을 적용합니다. `max`와 `ultra`도 허용하지만 더 낮은 rank 상한을 만들지는 않습니다(클라이언트가 `ultra`를 `max`로 변환하므로 요청은 `low`부터 `max`로 들어옵니다). 단, 알려진 모델 effort 사다리에 따라 단계가 내려가거나 필드가 제거될 수 있습니다. 대시보드 선택기는 `low`부터 `xhigh`까지 제공합니다. `GET /api/effort-caps`와 `PUT /api/effort-caps`로 관리합니다. |
24
+
| `subagentEffortCap?` | `string` | — | codex-rs가 생성한 자식 요청에 붙이는 표식, 즉 `x-openai-subagent` 헤더나 `x-codex-turn-metadata`의 `subagent_kind`로 식별된 서브에이전트 턴에만 같은 강제 상한을 적용합니다. `low`부터 `ultra`까지 허용하며 두 상한이 모두 설정되면 더 낮은 값이 적용되고, 값을 높이지 않고 낮추기만 합니다. 상한 이하에서 모델이 지원하는 가장 높은 단계로 내립니다. 모델이 effort 제어를 노출하지 않거나 상한 이하에 지원 단계가 없으면 effort 필드를 제거하고 프로바이더 기본값을 적용합니다. `max`와 `ultra`도 허용하지만 더 낮은 rank 상한을 만들지는 않습니다(클라이언트가 `ultra`를 `max`로 변환하므로 요청은 `low`부터 `max`로 들어옵니다). 단, 알려진 모델 effort 사다리에 따라 단계가 내려가거나 필드가 제거될 수 있습니다. 대시보드 선택기는 `low`부터 `xhigh`까지 제공합니다. `GET /api/effort-caps`와 `PUT /api/effort-caps`로 관리합니다. |
23
25
|`injectionPrompt?`|`string`| — | 주입되는 v2 안내 본문을 통째로 교체하는 커스텀 텍스트. `{{model}}`, `{{effort}}`, `{{roster}}` 플레이스홀더가 치환되며 발화 조건은 그대로입니다. `PUT /api/injection-model`의 `prompt` 키로도 설정할 수 있습니다. |
24
26
|`disabledModels?`|`string[]`| — | Codex에서 숨길 모델. 라우팅된 `provider/model` id는 카탈로그와 `/v1/models`에서 제외합니다. `gpt-5.4` 같은 일반 네이티브 GPT slug는 카탈로그 항목을 `visibility: "hide"`로 바꾸고 일반 `/v1/models` 목록에서 뺍니다. 대시보드 Models 페이지에서 모델별로 전환할 수 있습니다. |
25
27
|`multiAgentMode?`|`"v1" \| "default" \| "v2"`|`"default"`| 3단계 multi-agent surface override. `"v1"`은 업스트림 pin보다 우선해 모든 모델을 v1로, `"default"`는 업스트림 model pin(sol/terra=v2, luna=v1)을 따르고, `"v2"`는 모두 v2로 강제합니다. 대시보드 Models 페이지나 `ocx v2 mode`에서 설정합니다. |
Copy file name to clipboardExpand all lines: docs-site/src/content/docs/reference/configuration.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@ console warning, and starts with defaults. Missing files also fall back to a def
21
21
|`subagentModels?`|`string[]`|`gpt-5.5`, GPT-5.6 trio, `gpt-5.4-mini`| Up to 5 native slugs or `provider/model` ids featured first in Codex's subagent picker. Also injected into v2 delegation guidance as the available-model roster, annotated with the effort ladder each entry advertises in the catalog. An explicit empty list is preserved. |
22
22
|`injectionModel?`|`string`| — | Preferred native or routed model named in the injected multi-agent guidance (v2 surface); delegation is told to pass this exact model to `spawn_agent` with `fork_turns: "none"`. |
23
23
|`injectionEffort?`|`string`| — | Preferred `spawn_agent` reasoning effort (`low` through `ultra`). Only meaningful with `injectionModel`. |
24
+
|`effortCap?`|`string`| — | Hard per-request ceiling for the reasoning effort of every proxied turn (main agent and sub-agents). Accepts `low` through `ultra`; caps only lower, never raise. Snaps down to the highest supported rung at or below the cap. If the model exposes no effort control, or no supported rung fits under the cap, the effort field is removed and the provider default applies. `max` and `ultra` are accepted but do not impose a lower rank ceiling (requests arrive as `low` through `max` after the client's `ultra` → `max` conversion), though known model ladders may still cause snap-down or strip. The Dashboard picker offers `low` through `xhigh`. Managed via `GET /api/effort-caps` and `PUT /api/effort-caps`. |
25
+
|`subagentEffortCap?`|`string`| — | The same hard ceiling, applied only to sub-agent turns identified by codex-rs spawned-child markers: the `x-openai-subagent` header or `subagent_kind` in `x-codex-turn-metadata`. Accepts `low` through `ultra`; when both caps are set, the lower one wins, and caps only lower, never raise. Snaps down to the highest supported rung at or below the cap. If the model exposes no effort control, or no supported rung fits under the cap, the effort field is removed and the provider default applies. `max` and `ultra` are accepted but do not impose a lower rank ceiling (requests arrive as `low` through `max` after the client's `ultra` → `max` conversion), though known model ladders may still cause snap-down or strip. The Dashboard picker offers `low` through `xhigh`. Managed via `GET /api/effort-caps` and `PUT /api/effort-caps`. |
24
26
|`injectionPrompt?`|`string`| — | Custom override for the injected v2 guidance body. Replaces the built-in text; `{{model}}`, `{{effort}}`, and `{{roster}}` placeholders are substituted. Firing gates are unchanged. Settable via `PUT /api/injection-model` (`prompt` key). |
25
27
|`disabledModels?`|`string[]`| — | Models hidden from Codex. Routed `provider/model` ids are excluded from the catalog and `/v1/models`; bare native GPT slugs (e.g. `gpt-5.4`) flip their catalog entry to `visibility: "hide"` and drop from the bare `/v1/models` list. Toggleable per model from the dashboard Models page. |
26
28
|`multiAgentMode?`|`"v1" \| "default" \| "v2"`|`"default"`| 3-state multi-agent surface override. `"v1"` forces all models to the v1 surface (overrides upstream pins); `"default"` respects upstream model pins (sol/terra=v2, luna=v1); `"v2"` forces all models to v2. Settable from the dashboard Models page or `ocx v2 mode`. |
0 commit comments