# NousResearch/hermes-agent · messages.token_count not populated with completion tokens

## Open now

- 1 issue, 2 PRs open on GitHub.
- #136851: \[Bug\]: messages.token_count is never written — the column is NULL for every row in every session, though both the writer and the reader are implemented
- PR #136879: fix(agent): stamp the response completion tokens onto its assistant row
- PR #137149: fix(agent): stamp messages.token_count from each response's completion tokens

One issue reports that the messages.token_count column is NULL for every row even though a writer and reader exist. Two pull requests propose stamping each response's completion tokens onto the assistant message row; their actual effect is not established by the titles.

## TL;DR

- 3 member(s): 1 open issue(s), 0 closed issue(s), 2 open PR(s), 0 merged PR(s), 0 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## 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

- #136851: \[Bug\]: messages.token_count is never written — the column is NULL for every row in every session, though both the writer and the reader are implemented

## Prior & competing PRs

- **#136879: fix(agent): stamp the response completion tokens onto its assistant row**. open
  - maintainer direction: category `silent_close`; implication `active`
  - files: `agent/chat_completion_assistant_storage.py`, `agent/chat_completion_helpers.py`, `agent/conversation_loop.py`, `agent/turn_usage.py`, `tests/agent/test_message_token_count.py`
- **#137149: fix(agent): stamp messages.token_count from each response's completion tokens**. open
  - maintainer direction: category `silent_close`; implication `active`
  - files: `agent/chat_completion_helpers.py`, `agent/turn_usage.py`, `tests/agent/test_message_token_count_stamp.py`

## Fix status

- No merged fix on record.
- Subsystem: `agent`
