Skip to content

Commit ca73ac1

Browse files
juncursoragent
authored andcommitted
fix(cli): unblock dest CI after the agentic-control stack
The merged stack left GET /api/providers off the undeclared-route ratchet, apiError sites coalescing status to 1, a dispatch source scan that still expected console on sync-cache, and a stale generated skill surface. Co-authored-by: Cursor <[email protected]>
1 parent 7794485 commit ca73ac1

6 files changed

Lines changed: 16 additions & 14 deletions

File tree

‎skills/ocx/references/01_management_surface.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ JSON mode: `envelope`.
4444

4545
### `ocx capabilities`
4646

47-
Enumerate every CLI capability with the management routes it drives.
47+
List the declared CLI capabilities and the management routes they drive.
4848

4949
Drives no management route.
5050

@@ -56,21 +56,21 @@ Drives no management route.
5656

5757
JSON mode: `envelope`.
5858

59-
- Start here when driving ocx programmatically: it is the surface index.
59+
- Start here when driving ocx programmatically: it is the declared surface index, not a complete verb list.
6060

6161
### `ocx provider list`
6262

6363
Configured providers with connectivity and selected models.
6464

65-
| Method | Route |
66-
|---|---|
67-
| GET | `/api/providers` |
65+
Drives no management route.
6866

6967
| Flag | Value | Meaning |
7068
|---|---|---|
7169
| `--json` | boolean | Emit the provider list as JSON. |
7270

73-
JSON mode: `payload`.
71+
JSON mode: `envelope`.
72+
73+
- Reads local config; drives no management API route.
7474

7575
### `ocx account list`
7676

@@ -87,7 +87,7 @@ Codex OAuth accounts with pool priority and pause state.
8787
JSON mode: `payload`.
8888

8989
- STATUS names `paused` alongside `selected`: a paused-but-selected account still receives requests.
90-
- Quota is only fetched under `--quota` (a deliberate cost decision), so 5h and weekly percentages appear in `account list --quota`, not bare `account list`.
90+
- `--quota` shows cached Codex windows (including 5h); `--refresh` bypasses the server TTL.
9191

9292
### `ocx usage`
9393

@@ -365,7 +365,7 @@ Pause every Codex account whose quota is spent.
365365

366366
JSON mode: `envelope`.
367367

368-
- The route refreshes quota per account and can partially fail; a non-zero failed count is reported, because silence would read as `none were exhausted`.
368+
- The route refreshes quota per account and can partially fail; a non-zero failed count exits 1 and sets ok:false, because silence would read as `none were exhausted`.
369369

370370
### `ocx account strategy`
371371

‎src/cli/account-api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export interface FamilyRows {
179179
activeId: string | null;
180180
autoSwitchThreshold?: number;
181181
/** HTTP status for a completed family read, including failures. */
182-
status?: number;
182+
status: number;
183183
/** Set when the family endpoint returned an error. */
184184
errorJson?: Record<string, unknown>;
185185
networkDown?: boolean;

‎src/cli/account-extended.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function configAndType(deps: AccountDeps, name: string) {
238238

239239
function familyFailure(result: FamilyRows, fallback: string): number | null {
240240
if (result.networkDown) return proxyUnreachable(result.transportError);
241-
if (result.errorJson) return apiError(result.errorJson, fallback, result.status ?? 1);
241+
if (result.errorJson) return apiError(result.errorJson, fallback, result.status);
242242
return null;
243243
}
244244

‎src/cli/account.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ async function cmdList(rest: string[], deps: AccountDeps): Promise<number> {
188188
const r = await fetchRows(deps, baseUrl, t.name, t.type, wantsQuota ? { refresh: refreshQuota } : undefined);
189189
if (r.networkDown) return proxyUnreachable(r.transportError);
190190
if (r.errorJson) {
191-
if (name) return apiError(r.errorJson, `failed to list ${t.name}`, r.status ?? 1);
191+
if (name) return apiError(r.errorJson, `failed to list ${t.name}`, r.status);
192+
192193
const errorText = typeof r.errorJson.error === "string" ? r.errorJson.error : "";
193194
const skipUnknownKey = t.type === "api-key"
194195
&& r.status === 404
@@ -198,7 +199,7 @@ async function cmdList(rest: string[], deps: AccountDeps): Promise<number> {
198199
&& r.status === 400
199200
&& errorText.includes("unknown oauth provider");
200201
if (skipUnknownKey || skipConfigOAuth) continue;
201-
return apiError(r.errorJson, `failed to list ${t.name}`, r.status ?? 1);
202+
return apiError(r.errorJson, `failed to list ${t.name}`, r.status);
202203
}
203204
if (r.rows.length === 0) {
204205
if (showAll) notes.push(`${t.name}: no stored accounts or keys`);
@@ -245,7 +246,7 @@ async function cmdCurrent(rest: string[], deps: AccountDeps): Promise<number> {
245246
if (!baseUrl) return proxyUnreachable();
246247
const r = await fetchRows(deps, baseUrl, name, c.type);
247248
if (r.networkDown) return proxyUnreachable(r.transportError);
248-
if (r.errorJson) return apiError(r.errorJson, `failed to read ${name}`, r.status ?? 1);
249+
if (r.errorJson) return apiError(r.errorJson, `failed to read ${name}`, r.status);
249250

250251
const activeRow = r.rows.find(row => row.active) ?? null;
251252
if (wantsJson) {

‎tests/cli-capabilities.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ const UNDECLARED_ROUTES_2026_08_28: readonly string[] = [
222222
"GET /api/provider-context-caps",
223223
"GET /api/provider-presets",
224224
"GET /api/provider-quotas",
225+
"GET /api/providers",
225226
"GET /api/providers/keys",
226227
"GET /api/request-history",
227228
"GET /api/request-history/{id}",

‎tests/codex-app-server-processes.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ describe("CLI /api sync wiring for stale app-servers (#476)", () => {
647647
// restartCodex, quitting the user's app would ride along on a flag whose
648648
// documented contract is app-server-only.
649649
expect(handler).toContain('includes("--restart-desktop-app")');
650-
expect(handler).toContain("if (restartDesktopApp) await handleDesktopAppRestart(console)");
650+
expect(handler).toMatch(/if \(restartDesktopApp\) await handleDesktopAppRestart\((console|jsonSafeLog)\)/);
651651
expect(handler).not.toContain("restartDesktopApp = restartCodex");
652652
// Gated behind the same real-write condition as the app-server handling.
653653
const desktopAt = handler.indexOf("restartDesktopApp) await handleDesktopAppRestart");

0 commit comments

Comments
 (0)