fix: remove billing error false-positive from sanitizeUserFacingText#12226
Closed
Yida-Dev wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix: remove billing error false-positive from sanitizeUserFacingText#12226Yida-Dev wants to merge 1 commit intoopenclaw:mainfrom
Yida-Dev wants to merge 1 commit intoopenclaw:mainfrom
Conversation
sanitizeUserFacingText() runs on ALL outgoing messages (Telegram, etc.) and calls isBillingErrorMessage() which matches common words like "billing plan", "credit balance", "payment". This causes normal AI responses discussing billing topics to be replaced with the billing error banner. Real billing errors are already caught by formatAssistantErrorText() which correctly gates on stopReason === "error" before checking billing patterns. The check in sanitizeUserFacingText is redundant and harmful. Closes openclaw#11359 Co-Authored-By: Claude Opus 4.6 <[email protected]>
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:
Link back here for context. |
|
Manually patched our instance. Seems like its working. Thanks @Yida-Dev |
bfc1ccb to
f92900f
Compare
Contributor
|
Closing as superseded by the merged sanitize/error-context work:
This PR’s intent appears covered by those merged changes and current mainline tests. |
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
sanitizeUserFacingText()runs on all outgoing messages (Telegram, Slack, etc.) and callsisBillingErrorMessage()which false-positive matches common words like "billing plan", "credit balance", "payment" in normal AI responsesformatAssistantErrorText()which correctly gates onstopReason === "error"before checking billing patterns (line 331 + 388)isBillingErrorMessage()check insanitizeUserFacingText()is redundant and harmful — removed itTest plan
formatAssistantErrorTextstill catches real billing errors viastopReason === "error"gateCloses #11359
Co-Authored-By: Claude Opus 4.6 [email protected]
Greptile Overview
Greptile Summary
This change removes the
isBillingErrorMessage(trimmed)branch fromsanitizeUserFacingText()so that normal assistant responses mentioning billing-related terms (e.g., “billing plan”, “credit balance”, “payment method”) are no longer replaced with the generic billing banner.Billing error detection remains in
formatAssistantErrorText(), which is only used for assistant messages wherestopReason === "error"(or an expliciterrorMessage), keeping the billing banner behavior scoped to real provider failures. A regression test was added to ensure billing-related words in normal responses are preserved.Confidence Score: 5/5