openclaw - 💡(How to fix) Fix [Bug]: token counting broken with local LLM, only user prompts counted

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

After upgrading from 2026.5.12 to .5.18, context tokens-used status is missing output and too low

Root Cause

After upgrading from 2026.5.12 to .5.18, context tokens-used status is missing output and too low

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading from 2026.5.12 to .5.18, context tokens-used status is missing output and too low

Steps to reproduce

  1. Start OpenClaw 2026.5.18 with local LLM
  2. Take some turns in the control UI. Observe the context bubble is indicating very low, like hundreds of tokens used instead of the correct 13K+ (or however big the system prompt is). /status similarly indicates too low.

Expected behavior

The context use bubble and output of /status should show correct context usage.

Actual behavior

It appears only the user prompts are counted, i.e. my typing; nothing else is counted.

OpenClaw version

2026.5.20

Operating system

Ubuntu 24.04

Install method

npm global

Model

Qwen3.6-35B-A3B

Provider / routing chain

openclaw -> llama.cpp openai-completions API

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: not sure - at least local LLM users with llama.cpp and similar Severity: initially cosmetic, but I haven't driven it to where it should do compaction yet. I.e. it may undercount to the point compaction only occurs when the API returns a context-too-large message.

Additional information

Accurate context usage was last seen in 2026.5.12. It has been broken for me since 2026.5.18, and is still that way in 2026.5.20.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The context use bubble and output of /status should show correct context usage.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING