openclaw - 💡(How to fix) Fix session_status 显示的 contextWindow 与配置不一致 [1 comments, 2 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#44585Fetched 2026-04-08 00:44:55
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

Code Example

"diy": {
  "baseUrl": "https://coding.dashscope.aliyuncs.com/v1",
  "api": "openai-completions",
  "models": [
    {
      "id": "glm-5",
      "name": "GLM-5",
      "contextWindow": 204800,
      "maxTokens": 131072,
      "reasoning": true
    }
  ]
}

---

📚 Context: 0/128k (0%)
RAW_BUFFERClick to expand / collapse

问题描述

/statussession_status 显示的上下文窗口 (Context) 始终显示为 128k,即使模型配置中 contextWindow 设置为 200k (204800)。

配置信息

openclaw.json 中配置了自定义模型:

"diy": {
  "baseUrl": "https://coding.dashscope.aliyuncs.com/v1",
  "api": "openai-completions",
  "models": [
    {
      "id": "glm-5",
      "name": "GLM-5",
      "contextWindow": 204800,
      "maxTokens": 131072,
      "reasoning": true
    }
  ]
}

配置明确设置了 contextWindow: 204800 (200k),但 session_status 显示:

📚 Context: 0/128k (0%)

预期行为

session_status 应该显示 0/200k0/204800,与配置中的 contextWindow 一致。

实际行为

显示固定值 128k,与配置不符。

环境

  • OpenClaw 版本: 2026.3.11
  • 操作系统: Windows 10

备注

已尝试重启 gateway 多次,问题依旧。配置文件中的值已确认正确写入。

extent analysis

Fix Plan

To resolve the issue of the context window not reflecting the configured value, follow these steps:

  • Update the openclaw.json configuration file to ensure the contextWindow value is correctly set.
  • Verify that the maxTokens value is not limiting the contextWindow size.
  • Check for any hardcoded values in the OpenClaw codebase that may be overriding the configured contextWindow value.

Example code snippet to update the openclaw.json file:

"diy": {
  "baseUrl": "https://coding.dashscope.aliyuncs.com/v1",
  "api": "openai-completions",
  "models": [
    {
      "id": "glm-5",
      "name": "GLM-5",
      "contextWindow": 204800,
      "maxTokens": 204800, // Ensure maxTokens is not limiting contextWindow
      "reasoning": true
    }
  ]
}

Verification

After updating the configuration file, restart the OpenClaw gateway and verify that the session_status displays the correct context window size:

📚 Context: 0/200k (0%)

Extra Tips

  • Ensure that the OpenClaw version is up-to-date, as newer versions may have resolved similar issues.
  • If the problem persists, check the OpenClaw documentation and issue tracker for any known issues or workarounds related to context window configuration.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix session_status 显示的 contextWindow 与配置不一致 [1 comments, 2 participants]