Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9a65456
feat(accounts): read-only per-account Antigravity probe and manual mo…
andrew05060414 Nov 14, 2026
b588404
fix(antigravity): scope round-robin and session affinity per quota fa…
andrew05060414 Nov 14, 2026
7266985
feat(gui): per-account quota table on the Providers accounts tab
andrew05060414 Nov 14, 2026
86b9d54
fix(vertex): show gcloud ADC credentials as verified once a token is …
andrew05060414 Nov 14, 2026
ad92181
fix(gui): tighten the account quota table, probe line and discovery p…
andrew05060414 Nov 14, 2026
933abc3
fix(gui): a verified Vertex ADC row keeps the host-credentials auth l…
andrew05060414 Nov 14, 2026
7cff187
fix(cli): models discover exits nonzero when the server reports a fai…
andrew05060414 Nov 14, 2026
8c7b1d3
fix(quota): an Antigravity probe re-reads the roster so a pause made …
andrew05060414 Nov 14, 2026
847d890
fix(models): discovery refresh reports GET's arrival state and fetche…
andrew05060414 Nov 14, 2026
42d92b7
fix(vertex): a failed older ADC exchange no longer erases a newer exc…
andrew05060414 Nov 14, 2026
226b278
fix(oauth): Antigravity model-listing reroutes skip a sibling whose q…
andrew05060414 Nov 14, 2026
c5041cf
fix(gui): a late initial read no longer replaces refreshed arrivals, …
andrew05060414 Nov 14, 2026
9d54fb9
fix(gui): the account table marks a next account only under reset-first
andrew05060414 Nov 14, 2026
1cc8f97
docs(structure): account plan badges show mapped names; the next mark…
andrew05060414 Nov 14, 2026
d56f78b
feat(gui): make the account quota table the one OAuth account list
andrew05060414 Nov 14, 2026
9397d78
feat(gui): show an upstream-banned account as one red row in the acco…
andrew05060414 Nov 14, 2026
c652b43
fix(gui): stack account rows below 1100px so the pinned actions never…
andrew05060414 Nov 14, 2026
7c1b26b
fix(accounts): keep the last good model list on Discover now; show th…
andrew05060414 Nov 17, 2026
8673fae
test(accounts): cover banned rows, verification flag, probe controls,…
andrew05060414 Nov 17, 2026
7e0e5ae
Test account probe transport and management boundaries
lidge-jun Nov 18, 2026
ccf9918
Harden stored-account probes and finish dashboard and CLI parity
lidge-jun Nov 18, 2026
9ba63e9
Document discovery within the catalog reference budget
lidge-jun Nov 18, 2026
667419a
Give the OAuth quota table room for desktop columns
lidge-jun Nov 18, 2026
6a82b03
Require a live observation for manual model discovery
lidge-jun Nov 18, 2026
6ed68fc
Scope manual discovery and keep Antigravity account probes read-only
lidge-jun Nov 18, 2026
5c456ff
Keep full provider policy context for scoped model discovery
lidge-jun Nov 18, 2026
8cbcc99
Share scoped and full catalog provider discovery
lidge-jun Nov 18, 2026
f4d56cf
Fence shared catalog discovery by credential and outcome
lidge-jun Nov 18, 2026
9d2413d
Resolve provider workspace React Doctor findings
lidge-jun Nov 18, 2026
1fb41eb
Preserve caller-local Copilot rows after supersession
lidge-jun Nov 18, 2026
1540c92
Fence model discovery at admission and catalog publication
lidge-jun Nov 18, 2026
353d716
Cover superseded discovery on model listing routes
lidge-jun Nov 18, 2026
aaaf143
Project superseded discovery for model listing reads
lidge-jun Nov 18, 2026
537169b
Keep superseded Claude listings from replacing Desktop aliases
lidge-jun Nov 18, 2026
9be414b
Preserve complete Desktop snapshots when discovery is superseded
lidge-jun Nov 18, 2026
6acbeb7
Document Desktop snapshot retries in the Spanish API reference
lidge-jun Nov 18, 2026
2f775d5
Bind Desktop snapshot retries to listing policy
lidge-jun Nov 18, 2026
4283717
fix(desktop): retry superseded model snapshots
lidge-jun Nov 18, 2026
7e4e08b
test(gui): update OAuth account quota table assertions
lidge-jun Nov 18, 2026
aa1900b
Extract Anthropic model listing from server serve options
lidge-jun Nov 19, 2026
5f65185
fix(gui): show pause evidence in banned quota rows
lidge-jun Nov 19, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Per-account probe and manual model discovery

Status: contributor design for PR #8740.

## Problem

1. `POST /api/providers/test` resolves only the active account's token, so an operator with a
pool of Google Antigravity accounts cannot tell which individual accounts still work. Accounts
that started returning `permission_denied` could only be checked with an out-of-tree script.
2. Model discovery runs implicitly (catalog convergence, `liveModels`). There is no per-provider
"discover now" action, and recent arrivals only show as small NEW badges on the Models page.

## 1. Per-account probe

`POST /api/oauth/accounts/probe` — body `{ "provider": "google-antigravity", "accountId"?: string }`.
Omitting `accountId` probes every stored account (concurrency 4). Response:

```json
{ "provider": "google-antigravity", "probedAt": "<iso>",
"results": [{ "accountId": "…", "maskedLabel": "a***b@example.com", "active": true, "paused": false,
"status": "ok", "httpStatus": 200, "reason": null, "message": null,
"expiresAt": 0, "latencyMs": 412, "quota": { "customWindows": [] } }] }
```

`status` is one of:

| status | meaning | rule |
| --- | --- | --- |
| `ok` | usable | HTTP 200 |
| `paused` | account is paused by the operator; not tested | `account.paused === true`; no request is sent |
| `token_expired` | stored access token expired, not refreshed | `credential.expires <= now`; no request is sent |
| `suspended` | upstream says the account is suspended/disabled | 403 whose reason/message names suspension, disablement or ToS |
| `verification_required` | upstream asks the user to verify the account | 403 with `details[].reason == VALIDATION_REQUIRED` or "verify your account" wording |
| `rate_limited` | throttled / quota exhausted | 429 or `RESOURCE_EXHAUSTED` |
| `permission_denied` | other 403 | 403 |
| `error` | anything else (401, 5xx, transport, missing project) | `httpStatus` and `reason` carry the detail |

Read-only by construction:

- Uses the account's stored access token exactly as read through `getAccountSet()`; never calls
`getValidAccessToken`, never refreshes, never writes the auth store, never changes pause,
active, cooldown or health state. Paused accounts are skipped with status `paused` and no
request: an operator who parked an account has said not to use it, and a probe is still a use.
To test one, resume it first.
- One request: `POST https://daily-cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary`
with `{ "project": <projectId> }` and `User-Agent: antigravityCliUserAgent()`. Unlike the quota
poller there is no 403 retry under the IDE UA and no `fetchAvailableModels` fallback: the
first answer is the evidence, and the CLI fingerprint is the one that reports the Gemini group.
- Goes through the pinned provider-outbound transport used by the quota poller.
- The response uses closed reason codes and recognized quota-window labels.
The management API serializes probe runs and allows up to four requests per batch.

Only `google-antigravity` is supported for now; other providers get HTTP 400
`account probe is not supported for this provider`. The request/response shape is provider-neutral
so another provider can plug in a probe function later.

CLI: `ocx account probe <provider> [<account-id|alias>] [--json]` (capability registered in
`src/cli/capabilities-accounts.ts`).

GUI: Providers → Google Antigravity → Available accounts. Each account row gets a **Test** button;
the result renders under the row as a coloured badge plus `HTTP <code> · <reason>`.
The section head gets **Test all**.

## 2. Manual model discovery

`POST /api/model-discovery/refresh` — body `{ "provider": "<name>" }`.

1. 404 for an unknown provider; `{ ok: false, applicable: false, reason: "static_catalog" }` when the
provider has `liveModels: false` (no live endpoint to ask).
2. Snapshot the provider's `recentArrivals` ids, `expireModelCache(provider)`, then run the normal
catalog convergence (`convergeCodexCatalog`), which re-fetches the provider and records new
arrivals through the existing new-model policy.
3. Respond with `{ ok, provider, discovery, liveModelCount, newArrivals, recentArrivals, catalogRefresh }`,
where `newArrivals` are the arrivals recorded by this call and `discovery` is the provider's
discovery status (`ok` / `failed` + reason / http status).

CLI: `ocx models discover <provider> [--json]`.

GUI: provider settings, directly under the "Discover models from provider" toggle: a
**Discover now** button and a "Recently added" list (newest first, with date and whether the model
was auto-disabled by the new-model policy).

## Not changed

- `POST /api/providers/test` and the active-account path.
- Token refresh, re-login, pause/resume semantics.
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,31 @@ Para el grupo Codex, use `ocx account refresh openai [--json]`. Se actualiza a l

Para proveedores OAuth y de clave API, esto fuerza la actualización del punto final de informes de cuota del proveedor; no es un nuevo inicio de sesión de token ni una simple relectura de la lista de cuentas. `--json` devuelve `{ provider, report: ProviderQuotaReport | null }`. Un proveedor sin un informe de cuota compatible imprime `no quota report available for <provider>` y sale con 0. Los proveedores desconocidos y los fallos de la API de gestión salen con 1; una sonda de cuota ascendente que falla o expira se degrada a un informe nulo o desactualizado (código de salida 0), lo que coincide con las barras de cuota del panel.

### `ocx account probe google-antigravity [id|alias] [--json]`

Comprueba cada cuenta de Google Antigravity en modo de solo lectura. Cada cuenta recibe una
solicitud `retrieveUserQuotaSummary` con su propio token de acceso y la identidad de la CLI.
El resultado es `ok`, `rate_limited`, `verification_required`, `suspended`, `permission_denied`
o `error`, con el estado HTTP y un código de motivo reconocido. Los estados `paused`
(cuenta en pausa) y `token_expired` (token caducado) se determinan localmente, sin enviar
una solicitud. La comprobación conserva los tokens y el estado de la cuenta. Los botones
**Probar** y **Probar todas** de la tabla de cuotas de Antigravity llaman al mismo endpoint,
`POST /api/oauth/accounts/probe`. La tabla muestra el plan, las cuotas restantes por grupo,
los plazos de restablecimiento y las acciones de cada cuenta. Si falla una actualización,
la tabla conserva la cuota anterior e indica el error y las horas de lectura. Se ejecutan hasta cuatro
comprobaciones a la vez. Espera a que termine la comprobación actual antes de iniciar otra.

### `ocx models discover <provider> [--json]`

Ejecuta ahora la detección de modelos del proveedor e indica cuántos modelos encontró y
cuáles son nuevos. Es la misma acción que **Detectar ahora** en los ajustes del proveedor
(`POST /api/model-discovery/refresh`). Si ya hay una detección en curso para ese proveedor, la
acción devuelve HTTP 409 (`discovery_in_progress`) sin consultar al proveedor. Durante los 30
segundos posteriores a un fallo, la acción muestra ese
fallo y conserva la última lista válida sin volver a consultar al proveedor. La sincronización del
catálogo de Codex puede incorporar después la lista actualizada. Los catálogos estáticos indican
que la detección en directo está desactivada.

### `ocx account auto-switch <provider> <on|off|status|threshold <0-100>> [--json]`

Controla el umbral del grupo Codex `openai`, o almacena un umbral para un grupo OAuth genérico. `on` almacena el 80%, `off` almacena el 0% y `threshold <n>` acepta 0–100. Un umbral de grupo genérico dirige la selección solo mientras `pool.kernel` está activado con `strategy: "fill-first"`; con el indicador desactivado, guardar uno no habilita la conmutación basada en umbral. Nunca cambia la anulación de habilitación del proveedor ni desactiva la rotación reactiva 429. `status` y la salida de las mutaciones de grupos genéricos usan la respuesta confirmada del servidor. Para grupos genéricos, `poolEnabled` es la anulación almacenada del proveedor (`null` significa no especificado), no el estado efectivo heredado; `inert: true` significa que el umbral se almacena pero no se aplica, `inert: false` significa que el grupo lo está aplicando, y un `inert` ausente es una capacidad desconocida, que nunca informa `enabled: true`. Se rechazan los proveedores de clave API y los valores no válidos.
Expand Down
2 changes: 2 additions & 0 deletions docs-site/src/content/docs/es/reference/proxy-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ Sin `format=desktop-config`, los contratos de catálogo ordinarios son:

La combinación de este formato con `ids=cli` o cualquier `client_version` devuelve HTTP 400. Sin el selector de formato, los contratos ordinarios anteriores permanecen sin cambios. Cuando Claude está deshabilitado, la instantánea es `{ "version": 1, "models": [] }`; Connected Desktop apply trata esto como no disponible y no escribe un perfil de reemplazo. Los antiguos hubs que devuelven un catálogo ordinario en lugar de la versión 1 no son compatibles; el cliente no recurre a los ID generados localmente.

Si una operación de descubrimiento más reciente sustituye a la actual, el concentrador devuelve HTTP 503 con el código de error `desktop_snapshot_busy` y la cabecera `Retry-After: 1`. Al aplicar la configuración desde un cliente conectado, se conserva intacto el perfil de Claude Desktop existente.

La instantánea sigue siendo un contrato de lista de modelos de solo lectura; no es una rotación de claves ni una carga de perfil API. La migración, recuperación y desconexión de claves de escritorio conectadas funcionan a través del ciclo de vida del cliente existente. La rotación conserva las entradas y selecciones del modelo; CLI `rotation` distingue `committed` de `rolled_back`. Desconectar restaura la configuración propia o informa de una reserva estándar heredada conocida, preservando los campos de usuario y selecciones válidas posteriores. Los conflictos o la recuperación incompleta impiden una reclamación de finalización. Reinicie el escritorio para cargar los cambios de disco; la desconexión no revoca automáticamente la clave de concentrador. Véase [Claude Desktop ciclo de vida](/es/guides/claude-code/). La repetición de pensamiento y el trabajo de caché rápida permanecen separados en [#3719](https://github.com/lidge-jun/opencodex/issues/3719).

<a id="post-v1live-and-realtime-sideband"></a>
Expand Down
5 changes: 5 additions & 0 deletions docs-site/src/content/docs/guides/model-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ Routing and catalog visibility are separate controls:
Enabling an arrival manually keeps it enabled on later refreshes and exports.
If the running provider configuration differs from disk, model lists still apply the policy
using a temporary projection; they leave the running configuration and saved choices untouched.
If a newer discovery supersedes a successful response, the dashboard and ordinary model
listings can still show the older request's models under the visibility policy for that response.
When discovery is superseded or uses a temporary projection, the hub's Desktop configuration
endpoint returns a retryable HTTP 503 and connected apply keeps the current profile in place.
Anthropic listings using Desktop IDs show the visible aliases that already route to the same models.
Use `ocx models new-policy off` globally, add `--provider <name>` for an override, and inspect
`ocx models new-arrivals [--json]`. Failed/degraded fetches never change the baseline. Providers
with a non-empty `selectedModels` (including preset mode) are already curated, so `on` and `off`
Expand Down
24 changes: 24 additions & 0 deletions docs-site/src/content/docs/reference/cli/providers-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,30 @@ token re-login or a plain account-list re-read. `--json` returns
failures exit 1; an upstream quota probe that fails or times out degrades to a null or stale report
instead (exit 0), matching the dashboard's quota bars.

### `ocx account probe google-antigravity [id|alias] [--json]`

Read-only per-account check for Google Antigravity. Each account gets one
`retrieveUserQuotaSummary` request with its own stored access token, under the CLI fingerprint, and
the result is classified as `ok`, `rate_limited`, `verification_required`, `suspended`,
`permission_denied` or `error` (with the HTTP status and a recognized reason code). Two outcomes are decided
locally and send nothing: `paused` (the account is paused; resume it to test it) and `token_expired`
(the stored token has expired). The probe never refreshes a token, never writes the auth store and
never changes pause, active, cooldown or health state. The dashboard's **Test** and **Test all**
buttons on the Antigravity account quota table call the same endpoint, `POST /api/oauth/accounts/probe`.
The table shows each account’s plan, remaining quota by pool, reset times, and account actions.
If a quota refresh fails, the table keeps the cached quota and shows the failure and read times.
A batch runs up to four checks at a time. Wait for the current check to finish before starting another.

### `ocx models discover <provider> [--json]`

Runs the provider's live model discovery now instead of waiting for the next scheduled refresh, and
prints how many live models it saw and which ones are new. It is the same action as **Discover now**
under the provider's settings (`POST /api/model-discovery/refresh`). If discovery is already running
for that provider, the action reports it is in progress (HTTP 409, `discovery_in_progress`) without
contacting the provider. For 30 seconds after a failed fetch, the action reports that failure
and keeps the last good list without contacting the provider again. The separate Codex catalog
sync can pick up the refreshed list. Providers without live discovery report that discovery is off.

### `ocx account auto-switch <provider> <on|off|status|threshold <0-100>> [--json]`

Controls the `openai` Codex pool threshold, or stores a threshold for a generic OAuth pool. `on` stores 80%, `off` stores 0%, and `threshold <n>` accepts 0–100. A generic pool threshold steers selection only while `pool.kernel` is on with `strategy: "fill-first"`; with the flag off, saving one does not enable threshold-based switching. It never changes the provider enablement override or disables reactive 429 rotation. `status` and mutation output for generic pools use the confirmed server response. For generic pools, `poolEnabled` is the stored provider override (`null` means unspecified), not inherited effective state; `inert: true` means the threshold is stored but not applied, `inert: false` means the pool is applying it, and an absent `inert` is an unknown capability, which never reports `enabled: true`. API-key providers and invalid values are rejected.
Expand Down
4 changes: 4 additions & 0 deletions docs-site/src/content/docs/reference/proxy-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,10 @@ the snapshot is `{ "version": 1, "models": [] }`; connected Desktop apply treats
unavailable and does not write a replacement profile. Old hubs returning an ordinary catalog
instead of version 1 are unsupported; the client does not fall back to locally generated IDs.

If a newer discovery supersedes the request, the hub returns HTTP 503 with the error code
`desktop_snapshot_busy` and `Retry-After: 1`. Connected apply leaves the existing Desktop
profile byte-for-byte intact.

The snapshot remains a read-only model-list contract; it is not a key-rotation or profile-upload
API. Connected Desktop key migration, recovery and disconnect operate through the existing client
lifecycle. Rotation preserves model entries and selections; CLI `rotation` distinguishes
Expand Down
50 changes: 50 additions & 0 deletions gui/src/components/provider-workspace/AccountProbe.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { useT } from "../../i18n/shared";
import type { AccountProbeController, AccountProbeEntry, AccountProbeStatus } from "../../hooks/useAccountProbe";

function statusBadgeClass(status: AccountProbeStatus): string {
if (status === "ok") return "badge badge-green";
if (status === "token_expired" || status === "paused") return "badge badge-muted";
return "badge badge-amber";
}

export function AccountProbeButton({ controller, accountId, label, disabled }: {
controller: AccountProbeController; accountId: string; label: string; disabled?: boolean;
}) {
const t = useT();
const pending = controller.isPending(accountId);
return (
<button type="button" className="btn btn-ghost btn-sm"
aria-label={`${t("acctProbe.test")} — ${label}`}
title={t("acctProbe.hint")}
aria-busy={pending}
disabled={disabled || pending}
onClick={() => { void controller.probeOne(accountId); }}>
{pending ? t("acctProbe.testing") : t("acctProbe.test")}
</button>
);
}

/** One line under the account row: verdict badge, then HTTP code, reason and upstream message. */
export function AccountProbeResultLine({ entry }: { entry: AccountProbeEntry | undefined }) {
const t = useT();
if (!entry) return null;
const time = new Date(entry.at).toLocaleTimeString();
if ("failed" in entry) {
return <div className="pwi-auth-row-secondary pws-status-warn" role="status">{`${t("acctProbe.failed")} · ${time}`}</div>;
}
const { result } = entry;
// A usable account needs no evidence; its quota is already in the bars below and the table.
const evidence = result.status === "ok" ? "" : [
result.httpStatus !== null ? `HTTP ${result.httpStatus}` : null,
result.reason,
result.message,
].filter((part): part is string => Boolean(part)).join(" · ");
return (
<div className="pwi-auth-row-secondary" role="status" data-probe-status={result.status}
style={{ display: "flex", flexWrap: "wrap", alignItems: "center", gap: 6 }}>
<span className={statusBadgeClass(result.status)}>{t(`acctProbe.status.${result.status}`)}</span>
{evidence && <span className="pws-status-warn">{evidence}</span>}
<span className="faint">{time}</span>
</div>
);
}
Loading
Loading