Skip to content

Control UI: Context warning blocks screen on refresh with incorrect values #45230

@WsXiaoYao

Description

@WsXiaoYao

Bug Description

When refreshing the Control UI page, a context warning notice appears that blocks the entire screen, and the displayed context values are incorrect.

Steps to Reproduce

  1. Use Control UI for an extended conversation
  2. Refresh the page (F5 or Ctrl+R)
  3. Observe the warning notice

Actual Behavior

A warning notice appears with:

  • Full screen overlay that blocks all content
  • Incorrect values: 550.4k / 204.8k (usage > window size, which is impossible)

HTML structure:

<div class="context-notice" role="status" style="--ctx-color:rgb(220, 38, 38);--ctx-bg:rgba(220, 38, 38, 0.16)">
  <svg>...</svg>
  <span>100% context used</span>
  <span class="context-notice__detail">550.4k / 204.8k</span>
</div>

Expected Behavior

  1. Correct values: Usage should not exceed window size
  2. Non-blocking: Warning should not block the entire screen
  3. Proper styling: Should be a notification banner, not a full overlay

Environment

  • OpenClaw version: 2026.3.12
  • Browser: Chrome/Edge
  • OS: WSL2 (Linux)

Screenshot

The warning shows:

  • 100% context used
  • 550.4k / 204.8k (incorrect)

Related

This might be related to the token stats refresh issue (#45034) - both involve incorrect state on page refresh.

Suggested Fix

  1. Fix context calculation on page load
  2. Ensure warning component has proper z-index and doesn't block content
  3. Add proper state reset on page refresh

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