Skip to content
Merged
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
11 changes: 10 additions & 1 deletion docs-site/src/content/docs/ja/reference/management-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ CLI コマンドは Anthropic OAuth アカウントを id または一意の別
| `PUT /api/codex-auth/accounts/pause` | アカウントと、同じ ID 情報を持つ既存のメイン/プールのエントリを手動で一時停止または再開する。`affectedAccountIds` を返す | 400 無効なアカウント/状態、404 アカウントが見つからない、503 メインの ID 情報が使用中または読み取り不能 |
| `PUT /api/codex-auth/accounts/pause-exhausted` |クォータを使い果たしたアカウントを一時停止する |ミューテーションロックの失敗は 503 になります |
| `POST /api/codex-auth/accounts/clear-cooldown` | 1 つのアカウントまたはすべてのアカウントのランタイム クールダウンをクリアする | 400 無効な ID |
| `GET, PUT /api/codex-auth/active` |アクティブなアカウントを読み取るか選択します | 400 アカウントが無効または欠落しています。 409 一時停止/レガシー行の競合 |
| `GET, PUT /api/codex-auth/active` |アクティブなアカウントを読み取るか選択します | 400 アカウントが無効または欠落しています。 409 一時停止/レガシー行の競合、または `account_selection_unavailable` |
| `PUT /api/codex-auth/auto-switch` | `id` を省略した `{ threshold }` でグローバルしきい値、`{ id, threshold }` でアカウント別の上書き値を設定する。`id: '__main__'` は Codex Desktop アカウントを指定する。`id` を指定した場合、`threshold: null` は上書き値を削除してグローバル値の継承に戻す | 400 無効な ID/しきい値、404 アカウントなし |
| `PUT, PATCH /api/codex-auth/pool-strategy` | Codex アカウントプールの選択戦略を更新 | 400 無効な戦略/構成 |
| `PUT /api/codex-auth/failover` |アカウントのフェイルオーバーしきい値を設定する | 400 無効なしきい値 |
Expand All @@ -337,6 +337,15 @@ CLI コマンドは Anthropic OAuth アカウントを id または一意の別
| `POST /api/codex-auth/login/cancel` | `{ "flowId": "..." }` で指定した保留中の Codex ログインのみキャンセルする | 400 フロー ID が未指定、不明、または保留中ではない |
| `GET /api/codex-auth/login-status` |フローまたはアカウントのログイン状態をポーリングする。新規アカウント完了時は回復が必要な場合だけ `catalogRefreshPending: true` を含みます。 |不明なフローは `expired` を報告します。アクティブなフローは `idle` を報告しません |

`PUT /api/codex-auth/active` には `{ "accountId": "<id>" }` が必要です。選択をクリアするには、
明示的に `{ "accountId": null }` を指定します。別のプロセスが保存済みのアカウントを変更していても、
現在のアカウントの再選択は明示的な選択として扱われます。サーバーは無関係な保存済み設定を保持し、
ダッシュボードの読み込み後に削除または一時停止されたアカウントの選択を拒否します。保存済み設定が
利用できないか無効な場合、実行中の選択とアカウントへのアフィニティは変更されません。
設定を再読み込みしてから再試行してください。成功レスポンスはコミット済みの選択を示します。
既存のクォータとフェイルオーバーのルールによりピン留めが解除される場合は引き続きあります。
`pinDrained` は、現在判明しているピン留め解除の理由を示します。

新規 account の config row は保存されたものの credential setup を完了できない場合、OAuth の
`login-status` は `status: "error"` と
`code: "codex_credential_persistence_failed"`、`accountId`、`needsReauth: true`、必要に応じて
Expand Down
10 changes: 9 additions & 1 deletion docs-site/src/content/docs/ko/reference/management-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ OpenAI도 같은 규칙을 따르며, 스위치를 켠다고 별도의 922k 모
| `PUT /api/codex-auth/accounts/pause` | 계정과 동일한 로그인 정보를 가진 기존 메인/풀 항목을 수동으로 일시 중지하거나 재개합니다. `affectedAccountIds`를 반환합니다 | 400 잘못된 계정/상태; 404 계정 없음; 503 메인 계정의 로그인 정보가 사용 중이거나 읽을 수 없음 |
| `PUT /api/codex-auth/accounts/pause-exhausted` | quota가 소진된 account를 일시 중지합니다 | mutation-lock 실패는 503이 됩니다 |
| `POST /api/codex-auth/accounts/clear-cooldown` | account 하나 또는 모든 account의 runtime cooldown을 지웁니다 | 400 잘못된 id |
| `GET, PUT /api/codex-auth/active` | 활성 account를 읽거나 선택합니다 | 400 잘못되었거나 누락된 account; 409 paused/legacy-row 충돌 |
| `GET, PUT /api/codex-auth/active` | 활성 account를 읽거나 선택합니다 | 400 잘못되었거나 누락된 account; 409 paused/legacy-row 충돌 또는 `account_selection_unavailable` |
| `PUT /api/codex-auth/auto-switch` | `id`를 생략한 `{ threshold }`로 전역 임계값을, `{ id, threshold }`로 계정별 재정의 값을 설정합니다. `id: '__main__'`은 Codex Desktop 계정을 지정합니다. `id`가 지정된 경우 `threshold: null`은 재정의 값을 삭제하고 전역 임계값 상속을 복원합니다 | 400 잘못된 ID/임계값, 404 계정 없음 |
| `PUT, PATCH /api/codex-auth/pool-strategy` | Codex account-pool 선택 전략을 업데이트합니다 | 400 잘못된 전략/구성 |
| `PUT /api/codex-auth/failover` | account failover threshold를 설정합니다 | 400 잘못된 threshold |
Expand All @@ -349,6 +349,14 @@ OpenAI도 같은 규칙을 따르며, 스위치를 켠다고 별도의 922k 모
| `POST /api/codex-auth/login/cancel` | `{ "flowId": "..." }`로 지정한 대기 중인 Codex 로그인만 취소합니다 | 400 흐름 ID 누락, 알 수 없음 또는 대기 중이 아님 |
| `GET /api/codex-auth/login-status` | 흐름 또는 account 로그인 상태를 조회합니다. 새 계정 완료 시 복구가 필요할 때만 `catalogRefreshPending: true`를 포함합니다. | 알 수 없는 흐름은 `expired`로 보고되며, 활성 흐름이 없으면 `idle`로 보고됩니다 |

`PUT /api/codex-auth/active`에는 `{ "accountId": "<id>" }`가 필요합니다. 선택을 지우려면
`{ "accountId": null }`을 명시적으로 지정해야 합니다. 다른 프로세스가 저장된 계정을 변경했더라도
현재 계정을 다시 선택하는 것은 명시적인 선택으로 처리됩니다. 서버는 관련 없는 저장된 설정을
보존하고, 대시보드를 불러온 뒤 삭제되거나 일시 중지된 계정의 선택을 거부합니다. 저장된 구성을
사용할 수 없거나 구성이 유효하지 않으면 기존 런타임 선택과 계정 어피니티는 변경되지 않습니다.
설정을 다시 불러온 뒤 재시도하십시오. 성공 응답은 커밋된 선택을 나타냅니다. 기존 quota 및
failover 규칙에 따라 고정이 해제될 수 있으며, `pinDrained`는 현재 알려진 고정 해제 사유를 나타냅니다.

수동 소비가 `reset`으로 확인되면 같은 계정의 새 usage를 조회하여 기존 shared reset-derived
쿨다운을 즉시 복구할 수 있습니다. 복구는 조건부입니다. 계정이 일시 정지되었거나 재인증이
필요하거나 다른 진행 중인 probe가 쿨다운을 소유하면 쿨다운은 유지됩니다. reset 이전에 시작한
Expand Down
10 changes: 9 additions & 1 deletion docs-site/src/content/docs/reference/management-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ manager. Its routes are:
| `PUT /api/codex-auth/accounts/credits` | Allow or stop spending ChatGPT credits after the usage limit. Body `{ id, creditsAfterLimit }` for one account, including `__main__`: true adds the id to `creditCodexAccountIds`, false removes it. Body `{ all }` for the global switch: true lists `__main__` and every pool account, false clears the list. Applies to the next selection. | 400 invalid id or non-boolean value; 404 missing account |
| `PUT /api/settings` with `codexQuotaAutoRefresh: { id, window, enabled }` | Enable or disable 5-hour or weekly automatic window activation for one account | 400 invalid id/window/state; 404 missing account; 409 unavailable window |
| `POST /api/codex-auth/accounts/clear-cooldown` | Clear runtime cooldown for one account or all accounts | 400 invalid id |
| `GET, PUT /api/codex-auth/active` | Read or select the active account | 400 invalid or missing account; 409 paused/legacy-row conflict |
| `GET, PUT /api/codex-auth/active` | Read or select the active account | 400 invalid or missing account; 409 paused/legacy-row conflict or `account_selection_unavailable` |
| `PUT /api/codex-auth/auto-switch` | Set the global quota threshold with `{ threshold }`, or an account override with `{ id, threshold }`; `null` restores global inheritance, and `__main__` selects the Desktop login | 400 invalid id/threshold; 404 missing account |
| `PUT, PATCH /api/codex-auth/pool-strategy` | Update Codex account-pool selection strategy | 400 invalid strategy/config |
| `PUT /api/codex-auth/failover` | Set the account failover threshold | 400 invalid threshold |
Expand All @@ -729,6 +729,14 @@ manager. Its routes are:
| `POST /api/codex-auth/login/cancel` | Cancel only the pending Codex login identified by `{ "flowId": "..." }` | 400 missing, unknown, or non-pending flow ID |
| `GET /api/codex-auth/login-status` | Poll a flow or account login state. A completed new-account flow includes `catalogRefreshPending: true` only when recovery is needed. | Unknown flows report `expired`; no active flow reports `idle` |

`PUT /api/codex-auth/active` requires `{ "accountId": "<id>" }` or an explicit
`{ "accountId": null }` to clear selection. Re-selecting the current account is an explicit
selection even if another process changed the saved account. The server preserves unrelated
saved settings and rejects targets removed or paused since the dashboard loaded. An unavailable
or invalid saved configuration leaves the previous live selection and affinity unchanged; reload
settings before retrying. A successful response describes the committed selection. Existing quota
and failover rules can still release a pin; `pinDrained` reports a currently known drain reason.

For reset-credit consumption, a different `operationId` supplied while the same physical
account has an unfinished operation joins that operation as an alias. Its retry uses the
original upstream request ID and records the outcome under that same identity, so later
Expand Down
12 changes: 11 additions & 1 deletion docs-site/src/content/docs/ru/reference/management-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ picker изменилась. `catalogRefreshPending: true` в успешном
| `PUT /api/codex-auth/accounts/pause` | Вручную приостановить или возобновить аккаунт и существующие записи основного аккаунта и пула с той же идентичностью; возвращает `affectedAccountIds` | 400 неверный аккаунт/состояние; 404 аккаунт не найден; 503 данные идентичности основного аккаунта заняты или недоступны для чтения |
| `PUT /api/codex-auth/accounts/pause-exhausted` | Поставить на паузу аккаунты с исчерпанной квотой | Сбои mutation-lock превращаются в 503 |
| `POST /api/codex-auth/accounts/clear-cooldown` | Очистить runtime cooldown для одного аккаунта или для всех | 400 invalid id |
| `GET, PUT /api/codex-auth/active` | Прочитать или выбрать активный аккаунт | 400 invalid or missing account; 409 paused/legacy-row conflict |
| `GET, PUT /api/codex-auth/active` | Прочитать или выбрать активный аккаунт | 400 invalid or missing account; 409 paused/legacy-row conflict или `account_selection_unavailable` |
| `PUT /api/codex-auth/auto-switch` | Задать глобальный порог через `{ threshold }` без `id` или переопределение аккаунта через `{ id, threshold }`; `id: '__main__'` выбирает аккаунт Codex Desktop. При указанном `id` значение `threshold: null` удаляет переопределение и восстанавливает наследование глобального порога | 400 invalid id/threshold; 404 missing account |
| `PUT, PATCH /api/codex-auth/pool-strategy` | Обновить стратегию выбора в пуле аккаунтов Codex | 400 invalid strategy/config |
| `PUT /api/codex-auth/failover` | Задать порог failover аккаунтов | 400 invalid threshold |
Expand All @@ -376,6 +376,16 @@ picker изменилась. `catalogRefreshPending: true` в успешном
| `POST /api/codex-auth/login/cancel` | Отменить только ожидающий вход Codex с `{ "flowId": "..." }` | 400 ID потока отсутствует, неизвестен или не ожидает завершения |
| `GET /api/codex-auth/login-status` | Опрашивать flow или login-state аккаунта. Завершение нового аккаунта включает `catalogRefreshPending: true` только при необходимости восстановления. | Неизвестные flow'ы сообщаются как `expired`; отсутствие активного flow — как `idle` |

`PUT /api/codex-auth/active` требует `{ "accountId": "<id>" }` или явно указанного
`{ "accountId": null }` для сброса выбора. Повторный выбор текущего аккаунта считается явным
выбором, даже если другой процесс изменил сохранённый аккаунт. Сервер сохраняет остальные
сохранённые настройки и отклоняет выбор аккаунтов, удалённых или приостановленных после загрузки
панели управления. Если сохранённая конфигурация недоступна или некорректна, текущий выбор
в работающем процессе и привязка запросов к аккаунту не меняются; перед повторной попыткой
перезагрузите настройки. Успешный ответ описывает зафиксированный выбор. Существующие правила
квот и failover по-прежнему могут снять закрепление; `pinDrained` сообщает известную на данный
момент причину снятия закрепления.

Если config row нового аккаунта сохранён, но credential setup не завершён, OAuth `login-status`
сообщает `status: "error"` и содержит
`code: "codex_credential_persistence_failed"`, `accountId`, `needsReauth: true` и при необходимости
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ OpenAI 也遵循此规则:开关不会选择特殊的 922k 模式。有效上
| `PUT /api/codex-auth/accounts/pause` | 手动暂停或恢复账户及同身份的已有主登录/池内入口;返回 `affectedAccountIds` | 400 账户/状态无效;404 缺少账户;503 主登录身份忙碌或无法读取 |
| `PUT /api/codex-auth/accounts/pause-exhausted` | 暂停配额已耗尽的账户 | 变更锁失败会变成 503 |
| `POST /api/codex-auth/accounts/clear-cooldown` | 清除一个账户或所有账户的运行时冷却 | 400 id 无效 |
| `GET, PUT /api/codex-auth/active` | 读取或选择当前活跃账户 | 400 账户无效或缺失;409 暂停/旧行冲突 |
| `GET, PUT /api/codex-auth/active` | 读取或选择当前活跃账户 | 400 账户无效或缺失;409 暂停/旧行冲突或 `account_selection_unavailable` |
| `PUT /api/codex-auth/auto-switch` | 使用不含 `id` 的 `{ threshold }` 设置全局阈值,或使用 `{ id, threshold }` 设置账号覆盖值;`id: '__main__'` 选择 Codex Desktop 账号。指定 `id` 时,`threshold: null` 删除该账号的覆盖值并恢复继承全局阈值 | 400 ID/阈值无效;404 账号不存在 |
| `PUT, PATCH /api/codex-auth/pool-strategy` | 更新 Codex 账户池选择策略 | 400 策略/配置无效 |
| `PUT /api/codex-auth/failover` | 设置账户故障转移阈值 | 400 阈值无效 |
Expand All @@ -330,6 +330,13 @@ OpenAI 也遵循此规则:开关不会选择特殊的 922k 模式。有效上
| `POST /api/codex-auth/login/cancel` | 仅取消 `{ "flowId": "..." }` 指定的待处理 Codex 登录 | 400 流程 ID 缺失、未知或不在待处理状态 |
| `GET /api/codex-auth/login-status` | 轮询某个流程或账户登录状态。新账号流程完成时,仅在需要恢复时包含 `catalogRefreshPending: true`。 | 未知流程报告为 `expired`;没有活跃流程时报告为 `idle` |

`PUT /api/codex-auth/active` 必须包含 `{ "accountId": "<id>" }`,清除选择时必须显式传入
`{ "accountId": null }`。即使其他进程更改了已保存的账户,重新选择当前账户仍会被视为明确的选择操作。
服务器会保留其他已保存的设置,并拒绝选择在仪表盘加载后被删除或暂停的账户。如果已保存的配置不可用
或无效,当前运行时的账户选择和会话与账户的绑定关系将保持不变;请重新加载设置后再重试。
成功响应描述的是已提交的选择。现有的配额和故障转移规则仍可能解除账户固定;`pinDrained` 会报告
当前已知的固定解除原因。

如果新账号的 config row 已保存但 credential setup 未能完成,OAuth `login-status` 会报告
`status: "error"`,并包含
`code: "codex_credential_persistence_failed"`、`accountId`、`needsReauth: true`,并在需要时包含
Expand Down
1 change: 1 addition & 0 deletions scripts/test-layout/layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@
"codebuddy-tool-bridge-turn.test.ts": "providers",
"codebuddy-tool-bridge.test.ts": "providers",
"codex-account-delete-atomicity.test.ts": "codex-integration",
"codex-account-selection-atomicity.test.ts": "codex-integration",
"codex-account-label.test.ts": "codex-integration",
"codex-account-mode-state.test.ts": "gui",
"codex-account-namespaces.test.ts": "codex-integration",
Expand Down
Loading
Loading