fix(agents): avoid classifying reasoning-required errors as context overflow#24593
Merged
vincentkoc merged 3 commits intomainfrom Feb 23, 2026
Merged
Conversation
This was referenced Feb 23, 2026
3 tasks
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
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
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
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
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
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
Closed
6 tasks
plgs2005
pushed a commit
to plgs2005/openclaw
that referenced
this pull request
Feb 24, 2026
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
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
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
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
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
brianleach
pushed a commit
to brianleach/openclaw
that referenced
this pull request
Feb 26, 2026
2 tasks
mylukin
pushed a commit
to mylukin/openclaw
that referenced
this pull request
Feb 26, 2026
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
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
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
(cherry picked from commit 5e1dd5f) # Conflicts: # CHANGELOG.md
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
(cherry picked from commit 5e1dd5f) # Conflicts: # CHANGELOG.md
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…verflow (openclaw#24593) * Agents: exclude reasoning-required errors from overflow detection * Tests: cover reasoning-required overflow classification guard * Tests: format reasoning-required endpoint errors
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
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.
Summary
Reasoning is mandatory for this endpoint and cannot be disabled.could be misrouted into context-overflow handling.Context overflowguidance and embedded recovery paths may attempt the wrong remediation.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Reasoning is mandatory for this endpoint and cannot be disabled.) are no longer treated as context overflow./think minimalor another non-off level) and retry.Security Impact (required)
Repro + Verification
Environment
Steps
formatAssistantErrorText/ overflow classifiers with400 Reasoning is mandatory for this endpoint and cannot be disabled.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
isContextOverflowError,isLikelyContextOverflowError, andformatAssistantErrorTextfor reasoning-required messages.requires reasoningphrasing.Compatibility / Migration
Failure Recovery (if this breaks)
src/agents/pi-embedded-helpers/errors.ts, related tests.Risks and Mitigations
Greptile Summary
This PR prevents reasoning-constraint invalid-request errors from being misclassified as context overflow errors by adding explicit exclusions in overflow classifiers and a dedicated user-facing message.
Key changes:
isReasoningConstraintErrorMessage()helper that checks for phrases like "reasoning is mandatory", "reasoning is required", "requires reasoning", or "reasoning" + "cannot be disabled"isContextOverflowError()andisLikelyContextOverflowError()to exclude reasoning-constraint errors before checking overflow patternsformatAssistantErrorText()directing users to enable reasoning with/think minimalThe fix follows the same pattern as the recent Groq TPM fix (commit 652099c) by adding early-exit guards to prevent false classification.
Confidence Score: 5/5
Last reviewed commit: de2f65c