Commit Graph
5 Commits
Author SHA1 Message Date
Florian Schmidt 33458a40ed fix: forecast windows that are ahead early in their window (D7)
agent-review agent review: pass
The reach date, the dotted forecast and the popup warning showed only
for Claude. Codex had reset its week ten hours before and stood at
39 %, ahead by 33 points, but every forecast shared a gate that
opened only after 10 % of the window. Nothing in the forecast paths
was provider-specific; Codex was just the window early in its week.

The gate now also opens as soon as the window is ahead, with the
configured threshold, so it never disagrees with the chip. Average,
recent and popup forecasts all use it. Until forecasts start, the
tile and the window chart say when they will.

Refs #5
2026-10-15 18:58:06 +02:00
Florian Schmidt 07a645657d fix: keep real window instances across gaps and early resets (D7)
agent-review agent review: pass
The agent review of ab8d245 found that a gap between two instances,
normal for 5 h sessions, made the analysis infer a previous instance
up to the current start and drop the real one with its samples, and
that an early reset gave the old window tokens from before the new
window's first sample. Instance boundaries now come from resets; real
instances are kept with their own scale, gaps stay unassigned, and
inferred instances exist only for long windows without samples and
never overlap a real one. The dead top-8 breakdown builder is removed
and the day chart legend names the day-of-window pairing.

Refs #5
2026-10-15 09:59:27 +02:00
Florian Schmidt e687a40346 core: estimate window use from price-weighted tokens (D7)
Claude limit samples exist only while the app runs, so the day chart
and history of a week stayed empty although the token history covers
it. TokenWeights applies the providers' price ratios and LimitEstimates
scales the weighted tokens by the instance's measured use to estimate
spans without samples: days, the burn-up series and the peaks of past
instances, each marked measured or estimated. Estimates stop at the
limit, an instance ends where the next one begins, and forecasts wait
until 10 % of the window has passed.

Refs #5
2026-10-15 09:38:11 +02:00
Florian Schmidt a20d0ab9dc core: add limit forecasts, week days and per-model series (D7)
LimitAnalysis computes the use at reset at the average rate, a
recent-rate forecast from the last 24 h of samples, and for windows
longer than a day the use of each local day, today's use, the even
pace and the daily budget. Pace now projects the date of reaching
100 % whenever usage is over pace, not only past the threshold.
Samples whose resets lie within 15 minutes form one window instance,
because Claude's reset times drift by a minute between probes.
TokenSeriesByModel replaces one query per chart point, and a missing
settings.json on first start is no longer a diagnostic.

Refs #5
2026-10-14 22:59:24 +02:00
schmidt.florian f8afd11679 feat: add FinalToken v1 for Claude and Codex usage (#2)
FinalToken v1: a NativeAOT tray app for Windows 11 and CachyOS that tracks
Claude Code and Codex usage and limits through their CLIs only, with no
provider sign-in and no tokens (R1-R7, D1-D11).

- Core: incremental collectors for Claude transcripts and Codex
  rollouts, limit probes through `claude -p /usage` and
  `codex app-server`, a journaled history store, the refresh engine,
  pace and popup decisions, and the snapshot.json contract.
- App (Avalonia): stats panel with limit bars, pace, projections, token
  totals, charts, limit history and breakdowns; tray, settings,
  non-activating pace popups, single-instance activation, start with
  the OS, and the Off/Ask/Automatic Stream Deck plugin install.
- Stream Deck plugin (SDK v2, NativeAOT) for Elgato and OpenDeck.
- finaltoken-cli, tools/publish.py, the documentation check and the
  agent review workflow.

Closes #1
2026-10-14 22:11:19 +02:00