Skip to content

Bug: webchat status bar shows incorrect remaining tokens and context percentage #49824

@amlyx

Description

@amlyx

Description

The webchat UI status bar displays incorrect context usage metrics, inconsistent with the actual engine values.

Reproduction

  1. Open a webchat session
  2. Send messages to build up context
  3. Compare webchat status bar values vs /status or session_status tool output

Observed Behavior

Webchat status bar shows:

  • R927.2k (remaining tokens ~927k)
  • Context usage: 1%

Actual engine values (from session_status):

  • Context: 41k/200k (20%)
  • Actual remaining: ~159k

Expected Behavior

Webchat status bar should match the engine-reported context usage.

Environment

  • OpenClaw version: 2026.3.13
  • Model: zhipu/glm-5-turbo
  • Channel: webchat
  • OS: macOS Darwin 23.6.0 (arm64)

Additional Notes

The "R" (remaining) value appears to be calculated from a different/incorrect context window size than what is configured (200k). The 1% figure also does not match the 20% reported by the engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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