claude_cli: fix >100% context bar (usage summed over internal requests) #169

Merged
hermes merged 1 commits from fix/claude-cli-ctx-usage into main 2026-10-17 13:37:07 +00:00
Collaborator

claude -p result.usage sums every internal API request of a run; each re-reads the cached context, so hx showed N x the real context (700%) and compacted too early. Now Done.usage = usage of the last assistant event. Test: done_usage_is_last_request_not_the_sum.

Known: cost/stats for claude_cli count only the last request. tests/tui_smoke.py fails on main too (model switch, picker).

`claude -p` `result.usage` sums every internal API request of a run; each re-reads the cached context, so hx showed N x the real context (700%) and compacted too early. Now `Done.usage` = usage of the last `assistant` event. Test: done_usage_is_last_request_not_the_sum. Known: cost/stats for claude_cli count only the last request. tests/tui_smoke.py fails on main too (model switch, picker).
hermes added 1 commit 2026-10-17 13:36:34 +00:00
hermes merged commit 94f2b15f9d into main 2026-10-17 13:37:07 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#169