Skip to content

False positive billing error detection on assistant response text #12022

@bluerssen

Description

@bluerssen

Bug

OpenClaw's error pattern matching in pi-embedded-helpers scans assistant response text for billing-related keywords and incorrectly flags legitimate responses as billing errors.

Trigger Patterns

The ERROR_PATTERNS.billing check matches against:

  • Exact strings: "payment required", "insufficient credits", "credit balance", "plans & billing"
  • Regex: /\b402\b/
  • Combo: "billing" + any of "upgrade", "credits", "payment", "plan"

Reproduction

  1. Ask the agent to list issues from a project tracker (e.g. Linear) where issue titles contain phrases like "Show Credit Balance" or "only allow some models for some billing plans"
  2. The assistant's response contains these phrases in the issue titles
  3. isBillingErrorMessage() matches on the assistant text and replaces the entire response with: "⚠️ API provider returned a billing error — your API key has run out of credits or has an insufficient balance..."

Expected Behavior

The billing error detection should only apply to API error responses, not to the assistant's generated content. The assistant's reply text should never be scanned for these patterns.

Suggested Fix

Scope isBillingErrorMessage() to only check actual API/provider error payloads rather than scanning the full assistant message text.

Environment

  • OpenClaw 2026.2.6-3
  • Channel: Slack
  • Model: claude-opus-4-6

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions