-
-
Notifications
You must be signed in to change notification settings - Fork 40k
Description
Bug Report: Groq models trigger false "Context overflow" error
Summary
OpenClaw incorrectly calculates context limits for Groq models, causing immediate "Context overflow" errors even with minimal workspace context (~12KB) and simple messages. The error is mislabeled as a "billing" error, which then disables the auth profile.
Environment
- OpenClaw version: 2026.2.1 (ed4529e)
- OS: macOS Darwin 22.6.0
- Node: v22.22.0
- Groq models tested:
groq/llama-3.3-70b-versatile,groq/llama-3.1-8b-instant
Steps to Reproduce
-
Configure Groq as primary model:
openclaw models set groq/llama-3.3-70b-versatile -
Add Groq API key to auth-profiles.json
-
Send any WhatsApp message to trigger agent response
-
Observe immediate "Context overflow" error
Expected Behavior
- Groq
llama-3.3-70b-versatilehas 131,072 token context window (verified via Groq API) - Groq
llama-3.1-8b-instanthas 131,072 token context window - A ~12KB workspace + simple message should easily fit
Actual Behavior
FailoverError: Context overflow: prompt too large for the model.
Try again with less input or a larger-context model.
Error occurs within 248ms of request start, before any API call is made.
The error is then mislabeled as (billing) which disables the auth profile:
"usageStats": {
"groq:default": {
"errorCount": 1,
"failureCounts": { "billing": 1 },
"disabledReason": "billing"
}
}Verification: Direct Groq API Works
curl -s https://api.groq.com/openai/v1/chat/completions \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "llama-3.3-70b-versatile", "messages": [{"role": "user", "content": "Say hello"}]}'Response: Works correctly, returns "Hello! How can I assist you today?"
Attempted Workarounds (All Failed)
- Trimmed workspace files from 32KB to 12KB - still fails
- Cleared all session history - still fails
- Fresh gateway restart - still fails
- Cleared auth profile usageStats - profile gets disabled again on first request
Root Cause Hypothesis
OpenClaw appears to have a hardcoded or incorrectly configured context limit for Groq models that doesn't match their actual 131K context windows. The context calculation happens client-side before the API request.
Logs
[diagnostic] lane task error: lane=main durationMs=248
error="FailoverError: Context overflow: prompt too large for the model."
[diagnostic] lane task error: lane=session:agent:main:whatsapp:dm:+12177374277
durationMs=295 error="FailoverError: Context overflow..."
Embedded agent failed before reply: All models failed (2):
groq/llama-3.3-70b-versatile: Context overflow... (billing) |
groq/llama-3.1-8b-instant: No available auth profile for groq (all in cooldown)
Impact
- Groq integration is completely unusable
- Users cannot use free Groq API tier with OpenClaw
- Auth profiles get permanently disabled until manually cleared
Suggested Fix
Update Groq model context limits in OpenClaw's model registry to match actual values:
llama-3.3-70b-versatile: 131,072 tokensllama-3.1-8b-instant: 131,072 tokens- Other Groq models: Check https://api.groq.com/openai/v1/models for
context_windowfield