# NousResearch/hermes-agent · Fix token accounting for compaction decisions

## Open now

- 1 issue, 0 PRs open on GitHub.
- #104462: Token accounting: every compaction/overflow decision uses the provider's real usage, never the bytes/4 estimate

These items address how compaction and overflow decisions use token counts, shifting from a rough bytes-divided-by-4 estimate to the provider's actual reported usage, and preventing provider-safe prompts from incorrectly triggering local compaction.

## TL;DR

- 3 member(s): 1 open issue(s), 0 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #104555. Verify it addresses your case.
- **Recommended:** read PR #104555 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #104462: Token accounting: every compaction/overflow decision uses the provider's real usage, never the bytes/4 estimate

## Prior & competing PRs

- **#104555: fix(compression): compaction gates follow the provider's real usage, never the bytes/4 estimate (#104462, salvage #99585 #100447)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/agent_init.py`, `agent/codex_runtime.py`, `agent/context_breakdown.py`, `agent/context_compressor.py`, `agent/conversation_compression.py`, `agent/conversation_loop.py`, `agent/model_metadata.py`, `agent/turn_context.py`, `agent/turn_context_compaction.py`, `agent/turn_preflight.py`, `agent/turn_preflight_gate.py`, `agent/turn_request_assembly.py`, `agent/turn_usage.py`, `agent/usage_anchor.py`, `evals/token_accounting/replay_gates.py`, `gateway/run_turn.py`, `hermes_cli/cli_status_bar_mixin.py`, `tests/agent/test_budget_reasoning_details_exclusion.py`, `tests/agent/test_context_compressor.py`, `tests/agent/test_context_compressor_cross_session_guard.py` (+8 more)
- **#104516: fix(compression): stop provider-safe prompts from triggering local compaction**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `1d06f7a95a`, `a9e56c048a`, `#104555`, `#104462`

## Fix status

- Merged to main in PR #104555 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-06`.
- Subsystem: `agent`
