mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 14:04:58 +00:00
fix(telegram): prevent false-positive billing error detection in conversation text (#12946) thanks @jabezborja
This commit is contained in:
@@ -473,6 +473,7 @@ const ERROR_PATTERNS = {
|
|||||||
"insufficient credits",
|
"insufficient credits",
|
||||||
"credit balance",
|
"credit balance",
|
||||||
"plans & billing",
|
"plans & billing",
|
||||||
|
"insufficient balance",
|
||||||
],
|
],
|
||||||
auth: [
|
auth: [
|
||||||
/invalid[_ ]?api[_ ]?key/,
|
/invalid[_ ]?api[_ ]?key/,
|
||||||
@@ -533,16 +534,8 @@ export function isBillingErrorMessage(raw: string): boolean {
|
|||||||
if (!value) {
|
if (!value) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (matchesErrorPatterns(value, ERROR_PATTERNS.billing)) {
|
|
||||||
return true;
|
return matchesErrorPatterns(value, ERROR_PATTERNS.billing);
|
||||||
}
|
|
||||||
return (
|
|
||||||
value.includes("billing") &&
|
|
||||||
(value.includes("upgrade") ||
|
|
||||||
value.includes("credits") ||
|
|
||||||
value.includes("payment") ||
|
|
||||||
value.includes("plan"))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isMissingToolCallInputError(raw: string): boolean {
|
export function isMissingToolCallInputError(raw: string): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user