fix(telegram): reduce false positives billing error detection in conversation text#12946
Merged
gumadeiras merged 2 commits intoopenclaw:mainfrom Feb 10, 2026
Merged
fix(telegram): reduce false positives billing error detection in conversation text#12946gumadeiras merged 2 commits intoopenclaw:mainfrom
gumadeiras merged 2 commits intoopenclaw:mainfrom
Conversation
Contributor
Author
|
Hello @gumadeiras @thewilloftheshadow @cpojer, Would appreciate a review when you get a chance. This issue has been bugging me for quite a while as I've been working a lot with OpenClaw with Billing. Thank you!
|
quotentiroler
added a commit
that referenced
this pull request
Feb 10, 2026
- Fix code-size -> code-analysis job name (5 jobs had wrong dependency) - Remove useless install-check job (was no-op) - Add explicit docs_only guard to release-check - Remove dead submodule checkout steps (no submodules in repo) - Rename detect-docs-only -> detect-docs-changes, add docs_changed output - Reorder check script: format first for faster fail - Fix billing error test (PR #12946 removed fallback detection but not test)
trevorgordon981
pushed a commit
to trevorgordon981/openclaw
that referenced
this pull request
Feb 10, 2026
…ersation text (openclaw#12946) thanks @jabezborja
trevorgordon981
pushed a commit
to trevorgordon981/openclaw
that referenced
this pull request
Feb 10, 2026
…ersation text (openclaw#12946) thanks @jabezborja
trevorgordon981
pushed a commit
to trevorgordon981/openclaw
that referenced
this pull request
Feb 10, 2026
- Fix code-size -> code-analysis job name (5 jobs had wrong dependency) - Remove useless install-check job (was no-op) - Add explicit docs_only guard to release-check - Remove dead submodule checkout steps (no submodules in repo) - Rename detect-docs-only -> detect-docs-changes, add docs_changed output - Reorder check script: format first for faster fail - Fix billing error test (PR openclaw#12946 removed fallback detection but not test)
lucasmpramos
pushed a commit
to butley/openclaw
that referenced
this pull request
Feb 10, 2026
…ersation text (openclaw#12946) thanks @jabezborja
lucasmpramos
pushed a commit
to butley/openclaw
that referenced
this pull request
Feb 10, 2026
- Fix code-size -> code-analysis job name (5 jobs had wrong dependency) - Remove useless install-check job (was no-op) - Add explicit docs_only guard to release-check - Remove dead submodule checkout steps (no submodules in repo) - Rename detect-docs-only -> detect-docs-changes, add docs_changed output - Reorder check script: format first for faster fail - Fix billing error test (PR openclaw#12946 removed fallback detection but not test)
Hansen1018
pushed a commit
to Hansen1018/openclaw
that referenced
this pull request
Feb 10, 2026
…ersation text (openclaw#12946) thanks @jabezborja
Hansen1018
pushed a commit
to Hansen1018/openclaw
that referenced
this pull request
Feb 10, 2026
- Fix code-size -> code-analysis job name (5 jobs had wrong dependency) - Remove useless install-check job (was no-op) - Add explicit docs_only guard to release-check - Remove dead submodule checkout steps (no submodules in repo) - Rename detect-docs-only -> detect-docs-changes, add docs_changed output - Reorder check script: format first for faster fail - Fix billing error test (PR openclaw#12946 removed fallback detection but not test)
Contributor
skyhawk14
pushed a commit
to skyhawk14/openclaw
that referenced
this pull request
Feb 13, 2026
…ersation text (openclaw#12946) thanks @jabezborja
skyhawk14
pushed a commit
to skyhawk14/openclaw
that referenced
this pull request
Feb 13, 2026
- Fix code-size -> code-analysis job name (5 jobs had wrong dependency) - Remove useless install-check job (was no-op) - Add explicit docs_only guard to release-check - Remove dead submodule checkout steps (no submodules in repo) - Rename detect-docs-only -> detect-docs-changes, add docs_changed output - Reorder check script: format first for faster fail - Fix billing error test (PR openclaw#12946 removed fallback detection but not test)
This was referenced Feb 19, 2026
Closed
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
Refines the billing error detection logic to prevent false positives from conversational text (e.g., "billing plan") while ensuring legitimate errors like "insufficient balance" are correctly identified.
Problem
The
isBillingErrorMessagefunction was overly aggressive. It used a fallback check that would flag any message containing the word "billing" along with keywords like "plan", "upgrade", "credits", or "payment" as an error.This caused legitimate user queries (e.g., "How do I upgrade my billing plan?") to trigger the "API provider returned a billing error" UI, creating a confusing user experience.
Solution
matchesErrorPatterns, which checks against a list of specific error strings and regexes.Greptile Overview
Greptile Summary
This PR tightens billing error detection in
src/agents/pi-embedded-helpers/errors.tsby removing a broad fallback that treated conversational mentions of "billing" + related keywords as an error.isBillingErrorMessagenow relies solely on the explicitERROR_PATTERNS.billinglist viamatchesErrorPatterns, and the patterns list is extended to include the literal string "insufficient balance" so that common real billing failures are still classified correctly.This logic feeds into user-facing error rewriting (
formatAssistantErrorText/sanitizeUserFacingText) and failover classification (classifyFailoverReason), so reducing false positives here directly prevents the "API provider returned a billing error" UI from triggering on normal user questions.Confidence Score: 5/5
(2/5) Greptile learns from your feedback when you react with thumbs up/down!