openclaw - ✅(Solved) Fix [Bug]: Status shows wrong context window (1.0m instead of 200k) [1 pull requests, 2 comments, 3 participants]

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…
GitHub stats
openclaw/openclaw#51554Fetched 2026-04-08 01:09:41
View on GitHub
Comments
2
Participants
3
Timeline
11
Reactions
0
Author
Timeline (top)
commented ×2labeled ×2mentioned ×2subscribed ×2

Status shows wrong context window (1.0m instead of 200k)

Root Cause

Status shows wrong context window (1.0m instead of 200k)

Fix Action

Fixed

PR fix notes

PR #51795: fix(status): recompute fallback context window

Description (problem / solution / changelog)

Summary

  • recompute /status context-window reporting only after the active runtime model is fully settled
  • ignore stale persisted contextTokens when the session is actually being served by a fallback model
  • add regression coverage for fallback-model reporting and refresh the generated Plugin SDK baseline required on this branch

Testing

  • NODE_OPTIONS='--max-old-space-size=6144' pnpm plugin-sdk:api:check
  • pnpm test -- src/commands/status-json.test.ts src/commands/status.command.test.ts src/commands/status.command-flow.test.ts src/commands/gateway-status.test.ts src/commands/health.snapshot.test.ts

Fixes #51554

Changed files

  • docs/.generated/plugin-sdk-api-baseline.json (modified, +3/-3)
  • docs/.generated/plugin-sdk-api-baseline.jsonl (modified, +3/-3)
  • src/agents/tools/session-status-tool.ts (modified, +4/-0)
  • src/auto-reply/reply/commands-status.ts (modified, +4/-0)
  • src/auto-reply/status.test.ts (modified, +559/-1)
  • src/auto-reply/status.ts (modified, +131/-17)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Status shows wrong context window (1.0m instead of 200k)

Steps to reproduce

Set agents.defaults.model.primary to xiaomi/mimo-v2-flash (context 262k) Gateway falls back to MiniMax-M2.5 due to model not allowed (context 200k) Run /status - shows "Context: 49k/1.0m (5%)"

Expected behavior

Should show 200k context window for MiniMax-M2.5

Actual behavior

Shows 1.0m context window even though model is MiniMax-M2.5 with 200k context

OpenClaw version

2026.3.13

Operating system

Windows 10

Install method

No response

Model

MiniMax-M2.5 (minimax-portal)

Provider / routing chain

minimax-portal → MiniMax-M2.5 (原本配置 xiaomi/mimo-v2-flash,因 model not allowed 回退到 MiniMax-M2.5)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To resolve the incorrect context window issue, we need to update the status display logic to reflect the actual model's context window when a fallback occurs.

  • Check the model configuration for MiniMax-M2.5 and verify its context window is set to 200k.
  • Update the status display function to retrieve the context window from the current model's configuration instead of using a hardcoded value.

Example code snippet:

def get_context_window():
    # Get the current model
    current_model = get_current_model()
    
    # Retrieve the context window from the model's configuration
    context_window = current_model.config.get('context_window', 0)
    
    return context_window

def display_status():
    # Get the context window
    context_window = get_context_window()
    
    # Display the status with the correct context window
    print(f"Context: {context_window}")

Verification

To verify the fix, follow these steps:

  • Set the agents.defaults.model.primary to xiaomi/mimo-v2-flash (context 262k).
  • Run the gateway and ensure it falls back to MiniMax-M2.5 due to the model not being allowed.
  • Run the /status command and verify that it displays the correct context window (200k) for MiniMax-M2.5.

Extra Tips

  • Ensure that the model configurations are correctly updated and synced across all components.
  • Consider adding logging or monitoring to detect and report any discrepancies in model configurations or context windows.

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

Should show 200k context window for MiniMax-M2.5

Still need to ship something?

×6

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

Back to top recommendations

TRENDING