Commit 6999696
committed
feat: add /claude-prime — start 5h quota windows right after reset
Adds an opt-in PrimeManager that fires one minimal claude-haiku-4-5
request (~20 input tokens) about a minute after an account's 5h quota
window resets, so the window starts immediately instead of lagging
until the user's first real prompt.
- Cross-process single-fire via atomic wx marker files; markers are
namespaced per account-storage fingerprint (realpath sha256/12) so
multiple configs on one machine prime independently
- Keyed manager registry: one PrimeManager per (process x storage
fingerprint); plugin reloads adopt and rebind injected seams,
path changes stop and evict the old manager
- Self-healing bootstrap for idle accounts with no persisted resetsAt,
throttled and sentinel-guarded against cross-process amplification
- Freshness contract: prime decisions only on network-fetched quota
({ quota, fetched }), never re-stamped cache
- /claude-prime command (opencode modal + Pi display-only), sidebar
status rows, per-account usage counters in runtime state
- Killswitch-aware (model-scoped thresholds apply to the haiku probe)1 parent cb09a4d commit 6999696
23 files changed
Lines changed: 7140 additions & 29 deletions
File tree
- packages
- core/src
- tests
- opencode/src
- rpc
- tests
- tui
- pi/src
- tests
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
4 | 22 | | |
5 | 23 | | |
6 | 24 | | |
| |||
0 commit comments