-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
Phantom duplicate session key causes /status to show 0 tokens when real session has data #48204
Copy link
Copy link
Closed
Description
Bug
When using Telegram DM topics with 1M context window (Opus), OpenClaw creates two session entries for the same thread:
- Real session (full Telegram-specific key):
agent:main:telegram:personal:direct:<userId>:thread:<userId>:<topicId>- contains all usage data (totalTokens, inputTokens, outputTokens, cacheRead, cacheWrite) - Phantom session (short main-alias key):
agent:main:main:thread:<userId>:<topicId>- all fields arenull
When /status is invoked, it resolves to the phantom session (shorter "main" alias key), showing Context: 0/1.0m (0%) even though the real session has ~60k tokens of actual usage.
Evidence
# Real session (has data):
agent:main:telegram:personal:direct:XXXXX:thread:XXXXX:1039883
totalTokens: 60796
cacheRead: 59035
cacheWrite: 1760
model: claude-opus-4-6
contextTokens: 1000000
# Phantom session (empty):
agent:main:main:thread:XXXXX:1039883
totalTokens: null
totalTokensFresh: null
inputTokens: null
contextTokens: null
Expected Behavior
- Either only one session entry should exist per thread
- Or
/statusshould resolve to the session that has actual usage data
Environment
- OpenClaw 2026.3.14 (0d9d1ce)
- Model: anthropic/claude-opus-4-6 (1M context)
- Channel: Telegram DM with topics enabled
- Context window: 1,000,000 tokens configured
Related Issues
- [Bug]: Session key inconsistency causes duplicate sessions and missing messages in TUI/WebUI #9561 - Session key inconsistency causes duplicate sessions
- [Bug]: Token usage not being recorded in session history - totalTokens shows null #21819 - Token usage not being recorded (totalTokens shows null)
- TUI footer shows 0/200k tokens instead of configured contextTokens (1M) #11067 - TUI footer shows 0/200k instead of configured contextTokens
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.