The best way to control Claude Code, Codex and more from any computer or phone

main
md 68 lines 3.2 KB
Rendered Raw
1 # Usage limits hub fixture
2
3 A fake CLIProxyAPI hub that serves the Limits evidence scenarios in `scenarios.json`:
4
5 | Scenario | Accounts |
6 | -------- | ------------------------------------------------------------------------ |
7 | A | mixed Codex and Claude accounts |
8 | B | one account per provider |
9 | C | six long-email Codex accounts |
10 | F | xAI and Antigravity accounts that read, answer malformed, or are refused |
11 | L | named accounts (no email, so segments show the auth-file name) |
12 | P | one account per read hub provider, plus an unread Kiro account |
13 | T | forty accounts, so pooled segments are 4px wide at 390px |
14
15 Reset times are minute offsets from `n0`. An account's `state` of `malformed` or `refused` makes
16 its usage unreadable, so Limits leaves it out.
17
18 ## Rebuild a capture
19
20 1. Start a dev server with empty provider homes, so local logins add no accounts:
21
22 ```sh
23 CODEX_HOME=$(mktemp -d) CLAUDE_CONFIG_DIR=$(mktemp -d) vp run dev
24 ```
25
26 2. Write `state.json` as `{"scenario": "A", "n0": 1792515540000}`. That `n0` is 2026-10-20T16:59:00Z, the instant every published capture uses. Then start the hub:
27
28 ```sh
29 node hub.mjs state.json 18517
30 ```
31
32 3. Under Settings → Providers → Usage limit sources, add a hub with URL `http://127.0.0.1:18517`, any management key, and label `Team hub`. The composer panel prints that label on every account row.
33
34 4. Freeze the browser clock at `n0` from the devtools console:
35
36 ```js
37 const T = 1792515540000;
38 const R = Date;
39 window.Date = class extends R {
40 constructor(...a) {
41 super(...(a.length ? a : [T]));
42 }
43 static now() {
44 return T;
45 }
46 };
47 ```
48
49 Then re-read the time:
50 - On the Usage page, select Cost and then Limits again.
51 - Open the composer panel with `/usage-limits` after freezing.
52 - The sidebar's relative timestamp picks up the frozen clock on its next minute tick.
53
54 5. Viewports and themes: emulate `prefers-color-scheme` light and dark, and wait a few seconds after switching theme or size so transitions and overlay scrollbars settle.
55
56 | Surface | Viewport |
57 | ----------------------------------------------- | ------------------------------------- |
58 | Usage page | 1440×900 and 390×1500 |
59 | Scenario T | 390×3100, so the page does not scroll |
60 | Composer panel, Codex thread (`gpt-6-astra`) | 1440×900 |
61 | Composer panel, Claude thread (Claude Opus 5.5) | 390×1300 |
62
63 6. Edit `state.json` and press Refresh limits to switch scenarios.
64
65 ## Not from the fixture
66
67 - **"Codex: Could not read limits."** That banner comes from the local Codex install, which is unauthenticated with an empty `CODEX_HOME`.
68 - **"Claude API Key" rows** in the Claude composer panel come from the local Claude install, not the fixture.