Repository navigation
Commit 1b5d7b2
feat(fetcher): add codex_subscription — rate-limit utilisation from local JSONL
Codex CLI piggybacks plan rate-limit state on every `token_count` event in the
session JSONL (`primary` = 5h window, `secondary` = 7d window, `plan_type`).
This fetcher walks the newest session (via the discovery helpers from the
codex scaffold) and reads the last such event — the same view Codex itself
shows.
Deliberately no network call even though OpenAI's API can return the same
payload: the only way to re-fetch it is a billable inference request, which is
not what a splash widget should do. Freshness is bounded by "when did the user
last run Codex"; the renderer falls back to `resets now` for a window that has
already rolled over, which surfaces the staleness honestly.
Shape coverage matches `claude_subscription`: Ratio / Text / TextBlock /
MarkdownTextBlock / Entries / Bars / Badge / Timeline (eight). `Safety::Safe`.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent ebb7760 commit 1b5d7b2
2 files changed
Lines changed: 823 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | | - | |
7 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
0 commit comments