Skip to content

Commit b7e847e

Browse files
committed
fix: resolve shim, summary, and main auth issues
Fixes lidge-jun#322 Fixes lidge-jun#323 Fixes lidge-jun#327
1 parent c35f7dc commit b7e847e

28 files changed

Lines changed: 497 additions & 20 deletions

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ Here's a typical multi-provider setup:
357357
Provider entries can also annotate routed catalog metadata and output defaults. Use `contextWindow`
358358
for a provider-wide Codex-visible context cap, `modelContextWindows` for model-specific caps, and
359359
`modelInputModalities` for model-specific catalog input hints such as `["text"]` or
360-
`["text", "image"]`. For OpenAI-compatible chat providers whose upstream default response budget is
360+
`["text", "image"]`. For Responses models that reject Codex reasoning-summary delivery fields, set
361+
`modelSupportsReasoningSummaries.<model-id>` to `false`; this updates the catalog and strips stale
362+
summary-delivery fields at the adapter boundary. For OpenAI-compatible chat providers whose upstream default response budget is
361363
too small, set `defaultMaxOutputTokens` or per-model `modelMaxOutputTokens`; explicit
362364
`max_output_tokens` from the client still wins, and unset configs still omit `max_tokens`. Context
363365
values cap live `/models` metadata; they never raise a smaller live context window. The bundled
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Issues #322, #323, and #327
2+
3+
## #322 Codex shim subcommand detection
4+
5+
[Decision Log]
6+
- 목적과 의도: Codex global flag 뒤의 `app-server` 같은 management subcommand가 proxy autostart를 다시 켜지 않도록 한다.
7+
- 기존 구현 및 제약 조건: sh는 `$1`, cmd는 `%~1`, PowerShell은 `$firstArg`만 검사했다. 옵션 값은 positional token처럼 보일 수 있고 세 wrapper의 동작이 같아야 한다.
8+
- 검토한 주요 대안: 모든 인자에서 internal command 검색, 첫 non-flag 검색, 값 소비 옵션을 건너뛴 첫 positional token 검색.
9+
- 선택한 방식: 현재 Codex global value option 목록을 건너뛰고 첫 positional token만 subcommand로 판별한다.
10+
- 다른 대안 대신 이 방식을 선택한 이유: 모든 인자 검색은 prompt/하위 command 인자를 오인하고, 첫 non-flag 방식은 `read-only` 같은 옵션 값을 subcommand로 오인한다.
11+
- 장점, 단점 및 영향: flags-before-command를 세 OS wrapper에서 동일하게 처리한다. Codex에 새 value option이 추가되면 목록 동기화가 필요하다.
12+
13+
## #323 reasoning summary compatibility
14+
15+
[Decision Log]
16+
- 목적과 의도: 일부 Responses-compatible 모델이 거부하는 `reasoning_summary_delivery`를 모델별로 비활성화한다.
17+
- 기존 구현 및 제약 조건: unknown routed model은 summary 지원을 기본 `true`로 광고하고 adapter는 request body를 그대로 전달한다. 전역 default 변경은 정상 provider 기능을 불필요하게 낮춘다.
18+
- 검토한 주요 대안: 전역 default false, enum 전역 변환, 모델별 capability override와 adapter guard.
19+
- 선택한 방식: `modelSupportsReasoningSummaries` map을 catalog metadata에 반영하고 명시적 false 모델의 summary 필드를 adapter에서도 제거한다.
20+
- 다른 대안 대신 이 방식을 선택한 이유: upstream별 enum 지원이 다르므로 전역 변환은 안전하지 않고, adapter guard가 stale catalog client도 보호한다.
21+
- 장점, 단점 및 영향: 기존 설정은 byte-for-byte behavior를 유지한다. 호환성 문제가 있는 모델만 config opt-out이 필요하다.
22+
23+
## #327 main Codex account auth health
24+
25+
[Decision Log]
26+
- 목적과 의도: native `__main__` 계정의 missing/terminal-invalid credential 상태를 dashboard와 pool rotation에 동일하게 노출한다.
27+
- 기존 구현 및 제약 조건: main WHAM non-2xx는 전부 null quota로 축약됐고 DTO의 `hasCredential`은 항상 true였다. 일반 403을 terminal auth failure로 오판하면 정상 계정을 불필요하게 제외할 수 있다.
28+
- 검토한 주요 대안: 모든 401/403 mark, DTO-only 표시, 401 및 allowlisted structured 403 code만 runtime mark.
29+
- 선택한 방식: missing credential와 401, `invalid_workspace_selected`/`invalid_refresh_token`만 `needsReauth`로 mark하고 성공 refresh에서 clear한다.
30+
- 다른 대안 대신 이 방식을 선택한 이유: 실제 routing eligibility와 UI 상태를 맞추면서 generic permission failure의 false positive를 피한다.
31+
- 장점, 단점 및 영향: main과 pool의 관측성이 일치하고 invalid main이 rotation에서 제외된다. 새 terminal 403 code는 명시적으로 allowlist해야 한다.

‎docs-site/src/content/docs/guides/web-dashboard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The GUI is a thin client over the proxy's JSON management API. Useful endpoints
9595
| `GET /api/models` · `PUT /api/disabled-models` | List native/routed model rows and update the shared disabled-model set. |
9696
| `GET /api/key-providers` · `GET /api/oauth/providers` | Read the API-key and OAuth provider catalogs. |
9797
| `POST /api/oauth/login` · `GET /api/oauth/status` | Start a provider OAuth flow and poll for completion. |
98-
| `GET /api/codex-auth/accounts?refresh=1` | List main and pool accounts and force quota refresh. |
98+
| `GET /api/codex-auth/accounts?refresh=1` | List main and pool accounts, force quota refresh, and report main-account `hasCredential` / terminal `needsReauth` state. |
9999
| `PUT /api/codex-auth/active` · `PUT /api/codex-auth/auto-switch` · `PUT /api/codex-auth/failover` | Select the next-session account and configure pool routing. |
100100
| `POST /api/codex-auth/login` · `GET /api/codex-auth/login-status` | Add a pool account through browser login. |
101101
| `GET /api/logs?tail=50&provider=...&status=5xx` | Read recent request metadata with optional tail, provider, and exact/class status filters. |

‎docs-site/src/content/docs/ja/guides/web-dashboard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ GUI はプロキシの JSON 管理 API を使うシンクライアントです
9090
| `GET /api/models` · `PUT /api/disabled-models` | ネイティブ/ルーティングモデル行を参照し共有 disabled model 一覧を更新します。 |
9191
| `GET /api/key-providers` · `GET /api/oauth/providers` | API キーおよび OAuth プロバイダーカタログを読みます。 |
9292
| `POST /api/oauth/login` · `GET /api/oauth/status` | プロバイダー OAuth ログインを開始し完了可否を確認します。 |
93-
| `GET /api/codex-auth/accounts?refresh=1` | メインおよびプールアカウントを参照しクォータを強制更新します。 |
93+
| `GET /api/codex-auth/accounts?refresh=1` | メインおよびプールアカウントを参照しクォータを強制更新し、メインの `hasCredential` / terminal `needsReauth` 状態を返します。 |
9494
| `PUT /api/codex-auth/active` · `PUT /api/codex-auth/auto-switch` · `PUT /api/codex-auth/failover` | 次回セッションアカウントとプールルーティングポリシーを設定します。 |
9595
| `POST /api/codex-auth/login` · `GET /api/codex-auth/login-status` | ブラウザログインでプールアカウントを追加します。 |
9696
| `GET /api/logs?tail=50&provider=...&status=5xx` | tail、プロバイダー、正確な状態コードまたは状態等級で最近のリクエストメタデータを参照します。 |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ token の代わりに使えます。すべての候補は timing side channel
148148
| `refreshPolicy?` | `"proactive" \| "lazy-only" \| "disabled"` | この OAuth プロバイダーの Token Guardian ポリシー override。 |
149149
| `reasoningEfforts?` | `string[]` | 公表・送信するプロバイダー単位の Codex reasoning ラベル(`low`、`medium`、`high`、`xhigh`、`max`、`ultra`)。 |
150150
| `modelReasoningEfforts?` | `Record<string,string[]>` | モデル別 reasoning ラベル。空配列はそのモデルの effort control を隠します。 |
151+
| `modelSupportsReasoningSummaries?` | `Record<string,boolean>` | モデル別 reasoning summary capability。`false` にすると summary 対応を広告せず、`openai-responses` リクエスト前に summary-delivery フィールドを除去します。 |
151152
| `reasoningEffortMap?` | `Record<string,string>` | プロバイダー単位の reasoning ラベル wire alias。上流が別の値を要求するときだけ使います。 |
152153
| `modelReasoningEffortMap?` | `Record<string,Record<string,string>>` | モデル別 reasoning ラベル wire alias。 |
153154
| `noReasoningModels?` | `string[]` | reasoning/thinking パラメータを拒否するモデル。アダプターが `reasoning_effort` を削除します。 |

‎docs-site/src/content/docs/ko/guides/web-dashboard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ GUI는 프록시의 JSON 관리 API를 사용하는 얇은 클라이언트입니
9292
| `GET /api/models` · `PUT /api/disabled-models` | 네이티브/라우팅 모델 행을 조회하고 공용 disabled model 목록을 갱신합니다. |
9393
| `GET /api/key-providers` · `GET /api/oauth/providers` | API key 및 OAuth 프로바이더 카탈로그를 읽습니다. |
9494
| `POST /api/oauth/login` · `GET /api/oauth/status` | 프로바이더 OAuth 로그인을 시작하고 완료 여부를 확인합니다. |
95-
| `GET /api/codex-auth/accounts?refresh=1` | main 및 pool 계정을 조회하고 할당량을 강제로 갱신합니다. |
95+
| `GET /api/codex-auth/accounts?refresh=1` | main 및 pool 계정을 조회하고 할당량을 강제로 갱신하며 main 계정의 `hasCredential` / terminal `needsReauth` 상태를 표시합니다. |
9696
| `PUT /api/codex-auth/active` · `PUT /api/codex-auth/auto-switch` · `PUT /api/codex-auth/failover` | 다음 세션 계정과 풀 라우팅 정책을 설정합니다. |
9797
| `POST /api/codex-auth/login` · `GET /api/codex-auth/login-status` | 브라우저 로그인으로 pool 계정을 추가합니다. |
9898
| `GET /api/logs?tail=50&provider=...&status=5xx` | tail, 프로바이더, 정확한 상태 코드 또는 상태 등급으로 최근 요청 메타데이터를 조회합니다. |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ token 대신 쓸 수 있습니다. 모든 후보는 timing side channel을 막
153153
| `refreshPolicy?` | `"proactive" \| "lazy-only" \| "disabled"` | 이 OAuth 프로바이더의 Token Guardian 정책 override. |
154154
| `reasoningEfforts?` | `string[]` | 알리고 전송할 프로바이더 단위 Codex reasoning 레이블(`low`, `medium`, `high`, `xhigh`, `max`, `ultra`). |
155155
| `modelReasoningEfforts?` | `Record<string,string[]>` | 모델별 reasoning 레이블. 빈 배열은 해당 모델의 effort control을 숨깁니다. |
156+
| `modelSupportsReasoningSummaries?` | `Record<string,boolean>` | 모델별 reasoning summary capability. 모델 값을 `false`로 두면 summary 지원을 알리지 않고 `openai-responses` 요청 전에 summary-delivery 필드를 제거합니다. |
156157
| `reasoningEffortMap?` | `Record<string,string>` | 프로바이더 단위 reasoning 레이블 wire alias. 업스트림이 다른 값을 요구할 때만 사용합니다. |
157158
| `modelReasoningEffortMap?` | `Record<string,Record<string,string>>` | 모델별 reasoning 레이블 wire alias. |
158159
| `noReasoningModels?` | `string[]` | reasoning/thinking 파라미터를 거부하는 모델. 어댑터가 `reasoning_effort`를 제거합니다. |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ network. Only do this on trusted networks, and always set a strong `OPENCODEX_AP
168168
| `refreshPolicy?` | `"proactive" \| "lazy-only" \| "disabled"` | Override this OAuth provider's Token Guardian policy. |
169169
| `reasoningEfforts?` | `string[]` | Provider-wide Codex reasoning labels to advertise and send (`low`, `medium`, `high`, `xhigh`, `max`, `ultra`). |
170170
| `modelReasoningEfforts?` | `Record<string,string[]>` | Model-specific reasoning labels. An empty list hides the effort control for that model. |
171+
| `modelSupportsReasoningSummaries?` | `Record<string,boolean>` | Model-specific reasoning-summary capability. Set a model to `false` to stop advertising summaries and strip summary-delivery fields before an `openai-responses` request. |
171172
| `reasoningEffortMap?` | `Record<string,string>` | Provider-wide wire aliases for reasoning labels. Use only when the upstream expects a different value. |
172173
| `modelReasoningEffortMap?` | `Record<string,Record<string,string>>` | Model-specific wire aliases for reasoning labels. |
173174
| `noReasoningModels?` | `string[]` | Models that reject a reasoning/thinking param — the adapter drops `reasoning_effort` for them. |

‎docs-site/src/content/docs/ru/guides/web-dashboard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ GUI — это тонкий клиент поверх JSON-API управлен
9595
| `GET /api/models` · `PUT /api/disabled-models` | Список строк нативных/маршрутизируемых моделей и обновление общего набора отключённых моделей. |
9696
| `GET /api/key-providers` · `GET /api/oauth/providers` | Чтение каталогов провайдеров с API-ключом и OAuth. |
9797
| `POST /api/oauth/login` · `GET /api/oauth/status` | Запуск OAuth-процесса провайдера и опрос его завершения. |
98-
| `GET /api/codex-auth/accounts?refresh=1` | Список основного и пуловых аккаунтов с принудительным обновлением квот. |
98+
| `GET /api/codex-auth/accounts?refresh=1` | Список основного и пуловых аккаунтов с принудительным обновлением квот и состояниями `hasCredential` / terminal `needsReauth` основного аккаунта. |
9999
| `PUT /api/codex-auth/active` · `PUT /api/codex-auth/auto-switch` · `PUT /api/codex-auth/failover` | Выбор аккаунта следующей сессии и настройка маршрутизации пула. |
100100
| `POST /api/codex-auth/login` · `GET /api/codex-auth/login-status` | Добавление аккаунта пула через вход в браузере. |
101101
| `GET /api/logs?tail=50&provider=...&status=5xx` | Чтение метаданных недавних запросов с необязательными фильтрами tail, провайдера и точного/классового статуса. |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ x-opencodex-api-key: your-secret-token
172172
| `refreshPolicy?` | `"proactive" \| "lazy-only" \| "disabled"` | Переопределение политики Token Guardian для этого OAuth-провайдера. |
173173
| `reasoningEfforts?` | `string[]` | Метки рассуждений Codex на уровне провайдера, которые объявляются и отправляются (`low`, `medium`, `high`, `xhigh`, `max`, `ultra`). |
174174
| `modelReasoningEfforts?` | `Record<string,string[]>` | Метки рассуждений для конкретных моделей. Пустой список скрывает управление уровнем рассуждений для этой модели. |
175+
| `modelSupportsReasoningSummaries?` | `Record<string,boolean>` | Поддержка reasoning summary для отдельных моделей. Значение `false` отключает объявление summary и удаляет поля summary-delivery перед запросом `openai-responses`. |
175176
| `reasoningEffortMap?` | `Record<string,string>` | Wire-алиасы меток рассуждений на уровне провайдера. Используйте только когда вышестоящая сторона ожидает другое значение. |
176177
| `modelReasoningEffortMap?` | `Record<string,Record<string,string>>` | Wire-алиасы меток рассуждений для конкретных моделей. |
177178
| `noReasoningModels?` | `string[]` | Модели, отклоняющие параметр reasoning/thinking — адаптер удаляет для них `reasoning_effort`. |

0 commit comments

Comments
 (0)