When using LCM (Lossless Context Management), the Web UI occasionally displays incorrect context percentages (0% or >100%), while the /status command shows the correct value.
Example:
- Web UI shows: ctx = 0% or ctx = 150%
/status command shows: Context: 44%
This inconsistency occurs because the Web UI and /status command use different logic to calculate totalTokens. The Web UI checks a totalTokensFresh flag and falls back to a cumulative transcript usage value when the flag is false, which can result in either 0% (no data) or >100% (cumulative historical usage).
Expected Behavior:
Web UI should display the same context percentage as the /status command.
Environment:
- OpenClaw version: latest
- LCM enabled: yes
When using LCM (Lossless Context Management), the Web UI occasionally displays incorrect context percentages (0% or >100%), while the
/statuscommand shows the correct value.Example:
/statuscommand shows: Context: 44%This inconsistency occurs because the Web UI and
/statuscommand use different logic to calculatetotalTokens. The Web UI checks atotalTokensFreshflag and falls back to a cumulative transcript usage value when the flag isfalse, which can result in either 0% (no data) or >100% (cumulative historical usage).Expected Behavior:
Web UI should display the same context percentage as the
/statuscommand.Environment: