# NousResearch/hermes-agent · Image token estimation for TTFB watchdog and compression

## Open now

- Nothing open on GitHub.

Members appear to share one theme: estimating token cost of image-heavy content, with one report of the TTFB watchdog's estimate far exceeding API-reported prompt tokens. The other items propose pricing images by a learned, provider-usage-based cost instead of base64 length or a flat constant.

## TL;DR

- 4 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 2 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #104757. Verify it addresses your case.
- **Recommended:** read PR #104757 (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: `resolved` · deciding PR(s): `pr-104757`. 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.50`: 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.

## Closed / duplicate issues

- #63871: TTFB watchdog token estimator reports ~1.9M tokens while API prompt_tokens stays ~90-175K (extreme-aspect images / large data-URI tool output)

## Prior & competing PRs

- **#104575: feat(compression): image token cost learned from the provider's usage, not a flat constant (#70328, supersedes #70463)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/context_compressor.py`, `agent/image_token_cost.py`, `agent/model_metadata.py`, `agent/turn_context.py`, `agent/turn_usage.py`, `evals/token_accounting/ab_image_cost_calibration.py`, `gateway/run_turn.py`, `tests/agent/test_compressor_image_tokens.py`, `tests/agent/test_image_token_cost.py`, `website/docs/developer-guide/context-compression-and-caching.md`
- **#104757: fix(agent): watchdog estimator prices images at the learned cost, not base64 length (#63871, salvage #76471)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/chat_completion_helpers.py`, `tests/agent/test_context_estimator_multimodal.py`
- **#63913: fix(agent): reduce TTFB watchdog token over-estimation for image-heavy turns (#63871)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `922c0d670c`, `#104757`, `#76471`, `#104575`, `#63871`

## Fix status

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