Skip to content

Session totalTokens and context percentage stuck at 0 #1516

@cash-echo-bot

Description

@cash-echo-bot

Description

Session metadata shows totalTokens: 0 and Context: 0/200k (0%) even after multiple exchanges in an active session.

Impact

  • Compaction/pruning logic cannot trigger (thinks context is empty)
  • safeguard mode compaction won't kick in at 80% because it never sees usage
  • Session management decisions based on context size will be wrong

Reproduction

  1. Start a session (Discord channel, DM, etc.)
  2. Exchange several messages with tool calls
  3. Check session via sessions_list or session_status
  4. Observe totalTokens: 0 and Context: 0/200k (0%)

Expected

totalTokens should accumulate from per-message usage.totalTokens values. The per-message usage IS being tracked correctly (visible in message history), but the session-level aggregate stays at 0.

Config

{
  "contextPruning": { "mode": "off" },
  "compaction": { "mode": "safeguard" }
}

Version

Clawdbot 2026.1.22 (bfbeea0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions