Skip to content

Comments

fix: remove false positive context overflow detection#7567

Closed
kaigritun wants to merge 1 commit intoopenclaw:mainfrom
kaigritun:fix/false-positive-context-overflow
Closed

fix: remove false positive context overflow detection#7567
kaigritun wants to merge 1 commit intoopenclaw:mainfrom
kaigritun:fix/false-positive-context-overflow

Conversation

@kaigritun
Copy link

@kaigritun kaigritun commented Feb 3, 2026

Remove isContextOverflowError check from sanitizeUserFacingText to prevent false positives when the assistant mentions phrases like "context overflow" in normal conversation.

Real context overflow errors are already handled by formatAssistantErrorText, which properly checks msg.stopReason === "error" before applying error transformations.

Fixes #7483

Greptile Overview

Greptile Summary

This PR removes the isContextOverflowError() rewrite from sanitizeUserFacingText() to avoid false positives when normal assistant text mentions phrases like “context overflow”. Actual LLM error strings are still rewritten by formatAssistantErrorText(), which gates error-specific formatting on msg.stopReason === "error" (or an explicit errorMessage).

The change is localized to src/agents/pi-embedded-helpers/errors.ts and narrows the scope of “context overflow” handling to the error-formatting path rather than the general user-facing text sanitization path.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • The change is a small, targeted removal of an over-broad heuristic that could misclassify ordinary assistant text. Context overflow handling remains in the dedicated error formatting path, so the user-facing error UX should remain intact while reducing false positives.
  • No files require special attention

Remove isContextOverflowError check from sanitizeUserFacingText to prevent
false positives when the assistant mentions phrases like "context overflow"
in normal conversation.

Real context overflow errors are already handled by formatAssistantErrorText,
which properly checks msg.stopReason === "error" before applying error
transformations.

Fixes openclaw#7483
@Takhoffman
Copy link
Contributor

Fixed in #12988.

This will go out in the next OpenClaw release.

If you still see this after updating to the first release that includes #12988, please open a new issue with:

  • your OpenClaw version
  • channel (Telegram/Slack/etc)
  • the exact prompt/response that got rewritten
  • whether Web UI showed the full text vs the channel being rewritten
  • relevant logs around send/normalize (if available)

Link back here for context.

@Takhoffman Takhoffman closed this Feb 12, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive context overflow detection on normal response text

2 participants