fix(agents): suppress low context window warning for explicitly configured values#13986
Closed
0xRaini wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(agents): suppress low context window warning for explicitly configured values#139860xRaini wants to merge 1 commit intoopenclaw:mainfrom
0xRaini wants to merge 1 commit intoopenclaw:mainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
TWFBusiness
added a commit
to TWFBusiness/openclaw-tw
that referenced
this pull request
Feb 11, 2026
…pstream fixes - Remove Discord, Telegram, Slack, Signal, iMessage, BlueBubbles extensions - Remove @buape/carbon, grammy, and other gateway-specific dependencies - Add session-based login system (cookie auth, rate limiting) - Add type stubs for optional deps (baileys, ciao, qrcode-terminal) - Apply upstream PRs: XSS fix (openclaw#13952), orphan tool_results (openclaw#13974), Anthropic tool ID sanitization (openclaw#13976), BM25 score fix (openclaw#14005), redaction fix (openclaw#14006), subagent timeout (openclaw#13996), context window guard (openclaw#13986), model default reset (openclaw#13993), cache token accounting (openclaw#13853) - Fix all TypeScript compilation errors from channel removal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…gured values When users deliberately set a small contextWindow in their model config (e.g., 2048 for lightweight heartbeat checks), the 'low context window' warning is misleading noise. The warning should only fire for auto-detected or default values, not explicit user configuration. Skip shouldWarn when the context window source is 'modelsConfig' (models.providers[].models[].contextWindow) or 'agentContextTokens' (agents.defaults.contextTokens). shouldBlock is unchanged — hard minimum still enforced regardless of source. Fixes #13933
This comment was marked as spam.
This comment was marked as spam.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When users deliberately configure a small
contextWindowin their model config (e.g.,2048for lightweight heartbeat checks with a local model), OpenClaw still emits:This is misleading — the user intentionally chose this value.
Fixes #13933
Solution
Skip
shouldWarnwhen the context window source is explicitly configured:modelsConfig— set viamodels.providers[].models[].contextWindowagentContextTokens— set viaagents.defaults.contextTokensshouldBlock(hard minimum) is unchanged — still enforced regardless of source.Tests
Updated existing tests + added 2 new test cases confirming:
modelsConfigsource → no warningmodelsource → still warnsAll 11 tests pass.
AI Disclosure
This PR was authored with AI assistance.
Greptile Overview
Greptile Summary
Suppressed low context window warnings when users explicitly configure
contextWindowviamodels.providers[].models[].contextWindoworagents.defaults.contextTokens. The warning now only fires for auto-detected (model) or default values, preventing misleading warnings when users deliberately choose small context windows (e.g., 2048 tokens for lightweight heartbeat checks).Confidence Score: 5/5
shouldBlockenforcement. No breaking changes or side effects.