Skip to content

Fix Groq TPM limits misidentified as context overflow#16176

Merged
vincentkoc merged 2 commits intoopenclaw:mainfrom
dddabtc:fix/groq-tpm-overflow-misidentification
Feb 23, 2026
Merged

Fix Groq TPM limits misidentified as context overflow#16176
vincentkoc merged 2 commits intoopenclaw:mainfrom
dddabtc:fix/groq-tpm-overflow-misidentification

Conversation

@dddabtc
Copy link
Contributor

@dddabtc dddabtc commented Feb 14, 2026

Groq uses HTTP 413 for TPM (tokens per minute) limit errors. These were being incorrectly identified as context window overflows, causing OpenClaw to try resetting the session in an infinite loop. This fix excludes errors containing 'tpm' or 'tokens per minute' from being identified as context overflows and correctly classifies them as rate limits.

Greptile Summary

Fixed Groq TPM (tokens per minute) rate limit errors being misidentified as context overflow errors. Groq returns HTTP 413 with "too large" messages for rate limits, which was matching the context overflow pattern (lower.includes("413") && lower.includes("too large")) in isContextOverflowError(). This caused infinite retry loops as OpenClaw attempted to reset sessions for what it thought were context overflows. The fix adds early exclusion checks for "tpm" and "tokens per minute" strings in both isContextOverflowError() and isLikelyContextOverflowError(), and adds these patterns to the rate limit classifier.

  • Prevented TPM errors from triggering incorrect context overflow handling
  • Ensured TPM errors are properly classified as rate limits in ERROR_PATTERNS.rateLimit
  • Applied consistent exclusion logic across both context overflow detection functions

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is targeted, logical, and solves a specific misidentification bug without introducing new risks. The changes are minimal (adding exclusion checks and updating pattern arrays), the logic is sound (checking for rate-limit-specific terms before general overflow patterns), and the implementation is consistent across related functions. No breaking changes or side effects expected.
  • No files require special attention

Last reviewed commit: fd20686

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: XS labels Feb 14, 2026
@steipete steipete closed this Feb 16, 2026
@steipete steipete reopened this Feb 17, 2026
@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation size: S and removed size: XS labels Feb 19, 2026
@dddabtc dddabtc force-pushed the fix/groq-tpm-overflow-misidentification branch from 7a4d9f2 to e4880eb Compare February 19, 2026 19:17
@openclaw-barnacle openclaw-barnacle bot added size: XS and removed docs Improvements or additions to documentation size: S labels Feb 19, 2026
@vincentkoc vincentkoc merged commit 652099c into openclaw:main Feb 23, 2026
23 checks passed
vincentkoc added a commit that referenced this pull request Feb 23, 2026
jaydiamond42 pushed a commit to jaydiamond42/bloomtbot that referenced this pull request Feb 23, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
jaydiamond42 pushed a commit to jaydiamond42/bloomtbot that referenced this pull request Feb 23, 2026
carlosrivera pushed a commit to myascendai/meshiclaw that referenced this pull request Feb 23, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
carlosrivera pushed a commit to myascendai/meshiclaw that referenced this pull request Feb 23, 2026
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
(cherry picked from commit d601392)

# Conflicts:
#	CHANGELOG.md
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
(cherry picked from commit 652099c)
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
(cherry picked from commit d601392)

# Conflicts:
#	CHANGELOG.md
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
(cherry picked from commit 652099c)

# Conflicts:
#	src/agents/pi-embedded-helpers/errors.ts
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…text overflow (openclaw#16176)

Co-authored-by: Howard <dddabtc@users.noreply.github.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants