openclaw - 💡(How to fix) Fix [BUG] Infinite compacting loop for Custom Providers due to undersized contextWindow default #1 [2 pull requests]

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…

The openclaw onboard wizard assigns a hardcoded 4,000 token contextWindow to Custom Providers, which is smaller than the default 20,000 token reserveTokensFloor, triggering an immediate and infinite compaction loop.

Root Cause

The openclaw onboard wizard assigns a hardcoded 4,000 token contextWindow to Custom Providers, which is smaller than the default 20,000 token reserveTokensFloor, triggering an immediate and infinite compaction loop.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The openclaw onboard wizard assigns a hardcoded 4,000 token contextWindow to Custom Providers, which is smaller than the default 20,000 token reserveTokensFloor, triggering an immediate and infinite compaction loop.

Steps to reproduce

Run npm install -g openclaw and execute openclaw onboard.

Configure a Custom Provider (e.g., DashScope for Qwen 3.5 Plus).

Complete onboarding and launch OpenClaw.

Open the web dashboard and send any initial message to the agent.

Expected behavior

The agent should initialize with a context window reflecting the model's actual capacity (e.g., 256k for Qwen 3.5 Plus) or a safe default that exceeds the reserveTokensFloor (20,000 tokens), allowing for normal conversation.

Actual behavior

The system immediately reports "80%+ context used" and triggers "Compacting context" on the first turn. Investigation of openclaw.json shows contextWindow is hardcoded to 4000, while reserveTokensFloor in the runtime is 20000, creating a mathematical deadlock.

OpenClaw version

OpenClaw version: v2026.5.6 (c97b9f7)

Operating system

Operating system: Windows 11

Install method

Install method: npm install -g

Model

openclaw Model: Qwen-3.5-Plus

Provider / routing chain

Provider / routing chain: Alibaba DashScope (Custom Provider)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

The issue lies in dist/onboard-custom-config-BHXfgRIq.js where DEFAULT_CONTEXT_WINDOW is set to 4000. This value is insufficient for modern LLMs and directly conflicts with the default compaction.reserveTokensFloor of 2e4 (20,000) found in the agent runner.

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

The agent should initialize with a context window reflecting the model's actual capacity (e.g., 256k for Qwen 3.5 Plus) or a safe default that exceeds the reserveTokensFloor (20,000 tokens), allowing for normal conversation.

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 [BUG] Infinite compacting loop for Custom Providers due to undersized contextWindow default #1 [2 pull requests]