feat(webui): the Triage host counts tokens per turn and holds the daily cap (#1873) #1992

Merged
jason.woltje merged 2 commits from triage-cap into refactor 2026-11-18 20:33:46 +00:00
2 Commits
Author SHA1 Message Date
jason.woltje 57af33630d test(triage): a repeated usage.begin keeps the first baseline (review round, #1873, lane triage-cap) 2026-11-18 14:03:50 -06:00
jason.woltje 17b972b92d feat(triage): the host holds the daily token cap
Each turn's usage goes to <dataRoot>/triage/usage.jsonl, one line per
usage.end, 0600 and owned by the running user; a link, wrong mode or
owner, or a non-file refuses. The host holds the stored cap through
daily-quota mayLaunch and report before each start and each queued
message, lets a crossing turn finish, drains the queue with a host
line, sums the file again after a restart (a torn line counts as an
unknown turn), and GET /api/triage adds usageToday, cap and resetsAt.
With no route stored the fields say "not set". cli.mjs keeps route
null. (#1873, lane triage-cap)
2026-11-18 14:03:50 -06:00