Skip to content

Groq models trigger false Context overflow error #10094

@hummbl-dev

Description

@hummbl-dev

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

  1. Configure Groq as primary model:

    openclaw models set groq/llama-3.3-70b-versatile
  2. Add Groq API key to auth-profiles.json

  3. Send any WhatsApp message to trigger agent response

  4. Observe immediate "Context overflow" error

Expected Behavior

  • Groq llama-3.3-70b-versatile has 131,072 token context window (verified via Groq API)
  • Groq llama-3.1-8b-instant has 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)

  1. Trimmed workspace files from 32KB to 12KB - still fails
  2. Cleared all session history - still fails
  3. Fresh gateway restart - still fails
  4. 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:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions