Bug
The /status command in Discord/Telegram/etc always shows Tokens: 0 regardless of how many tokens the session has consumed.
Root Cause
SessionEntry.total_tokens is initialized to 0 in the dataclass constructor and never updated during the session lifecycle. The agent tracks cumulative tokens internally on agent.session_total_tokens, but that value is never written back to the session store's SessionEntry.
The update_session() method only accepts last_prompt_tokens — there's no pathway for total_tokens to be persisted.
Steps to Reproduce
- Start a gateway session (Discord, Telegram, etc.)
- Send a few messages so the agent consumes tokens
- Run
/status
- Observe
Tokens: 0
Expected Behavior
/status should show the cumulative token count for the current session.
Fix
PR incoming — adds total_tokens parameter to update_session() and pipes agent.session_total_tokens through the result dict after each agent run.
Bug
The
/statuscommand in Discord/Telegram/etc always showsTokens: 0regardless of how many tokens the session has consumed.Root Cause
SessionEntry.total_tokensis initialized to0in the dataclass constructor and never updated during the session lifecycle. The agent tracks cumulative tokens internally onagent.session_total_tokens, but that value is never written back to the session store'sSessionEntry.The
update_session()method only acceptslast_prompt_tokens— there's no pathway fortotal_tokensto be persisted.Steps to Reproduce
/statusTokens: 0Expected Behavior
/statusshould show the cumulative token count for the current session.Fix
PR incoming — adds
total_tokensparameter toupdate_session()and pipesagent.session_total_tokensthrough the result dict after each agent run.