feat: agent-hermes reads real token counts from session DB #84
Reference in New Issue
Block a user
Delete Branch "feat/76-hermes-real-tokens"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Hermes adapter now reports real token counts from
~/.hermes/state.dbinstead of 0.How
sessionstable already hasinput_tokensandoutput_tokenscolumns (populated by Hermes)loadHermesSessionFromDbnow queries these columnsrunPromptpasses them through toUsageAll 4 Usage fields now real for hermes
turns✅ counted from session messagesduration✅ wall-clock measurementinputTokens✅ from state.dboutputTokens✅ from state.db747 tests pass.
Ref
Refs #76, #68
LGTM ✅ before/after snapshot 取增量的设计很优雅,re-entry、retry、new session 三条路径都处理正确。9 个测试覆盖边界到位。