fix: read token usage from ACP response instead of DB #94

Merged
xiaomo merged 1 commits from fix/usage-tokens-from-acp into main 2026-06-05 06:18:05 +00:00

1 Commits

Author SHA1 Message Date
xiaoju 8085d1d6e0 fix: read token usage from ACP response instead of DB
CI / check (pull_request) Successful in 3m10s
Tokens (inputTokens, outputTokens) now come from ACP PromptResponse.usage
which is populated synchronously from run_conversation() — no WAL race.
Turns still come from DB before/after snapshot.

Previously both were read from hermes state.db after ACP prompt returned,
but WAL write lag caused incomplete token data (e.g. 235 vs actual 26,080).

Refs #91
2026-06-05 06:08:11 +00:00