fix: recognize Poe 402 'used up your points' as billing for fallback#42278
Merged
altaywtf merged 2 commits intoopenclaw:mainfrom Mar 10, 2026
Merged
fix: recognize Poe 402 'used up your points' as billing for fallback#42278altaywtf merged 2 commits intoopenclaw:mainfrom
altaywtf merged 2 commits intoopenclaw:mainfrom
Conversation
Contributor
Greptile SummaryThis PR makes a single, targeted fix: it extends
Confidence Score: 5/5
Last reviewed commit: 893e276 |
893e276 to
bf7d145
Compare
Poe API returns '402 You've used up your points! Visit https://poe.com/api/keys to get more.' which was not matched by RAW_402_MARKER_RE (requires 'payment required'). Add Poe-specific pattern to RAW_402_MARKER_RE so fallback triggers. Ref: https://poe.com/api/keys Made-with: Cursor
bf7d145 to
f3cdfa7
Compare
Member
|
Merged via squash.
Thanks @CryUshio! |
4 tasks
frankekn
pushed a commit
to MoerAI/openclaw
that referenced
this pull request
Mar 11, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
frankekn
pushed a commit
to Effet/openclaw
that referenced
this pull request
Mar 11, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
frankekn
pushed a commit
to ImLukeF/openclaw
that referenced
this pull request
Mar 11, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Treedy2020
pushed a commit
to Treedy2020/openclaw
that referenced
this pull request
Mar 11, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
dhoman
pushed a commit
to dhoman/chrono-claw
that referenced
this pull request
Mar 11, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
ahelpercn
pushed a commit
to ahelpercn/openclaw
that referenced
this pull request
Mar 12, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Ruijie-Ysp
pushed a commit
to Ruijie-Ysp/clawdbot
that referenced
this pull request
Mar 12, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
leozhengliu-pixel
pushed a commit
to leozhengliu-pixel/openclaw
that referenced
this pull request
Mar 13, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Interstellar-code
pushed a commit
to Interstellar-code/operator1
that referenced
this pull request
Mar 16, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf (cherry picked from commit 8bf64f2)
senw-developers
pushed a commit
to senw-developers/va-openclaw
that referenced
this pull request
Mar 17, 2026
…penclaw#42278) Merged via squash. Prepared head SHA: f3cdfa7 Co-authored-by: CryUshio <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
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.
Poe API returns '402 You've used up your points! Visit https://poe.com/api/keys to get more.' which was not matched by RAW_402_MARKER_RE (requires 'payment required'). Add Poe-specific pattern to RAW_402_MARKER_RE so fallback triggers.
Ref: https://poe.com/api/keys
Made-with: Cursor
Summary
Describe the problem and fix in 2–5 bullets:
402 You've used up your points! Visit https://poe.com/api/keys to get more.when credits are exhausted.RAW_402_MARKER_REonly matches402 payment requiredand similar patterns, so this error is not recognized as billing.classifyFailoverReasonreturnsnull, fallback is not triggered, and the user sees a generic failure instead of automatic failover to another model.|^\s*402\s+.*used up your points\btoRAW_402_MARKER_REso Poe's 402 message is treated as billing and triggers fallback.classifyFailoverReasonFromHttpStatus, and non-Poe providers are unchanged. Only Poe's specific "used up your points" text is matched.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.402 You've used up your points!, model fallback now triggers instead of failing with an unclassified error.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation: N/ARepro + Verification
Environment
agents.defaults.modelswith Poe + fallback model (e.g. OpenRouter)Steps
Expected
Actual
classifyFailoverReasonreturnsnull, no fallback, generic error shown.billing, fallback triggers.Evidence
Attach at least one:
Added
pi-embedded-helpers.isbillingerrormessage.test.tscase for Poe 402 message; regex logic verified via standalone Node script.Human Verification (required)
What you personally verified (not just CI), and how:
402 You've used up your points! Visit https://poe.com/api/keys to get more.; existing 402 patterns (e.g.402 Payment Required) still match.used up your points); does not match arbitrary402 xxxtext.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/agents/pi-embedded-helpers/errors.ts,src/agents/pi-embedded-helpers.isbillingerrormessage.test.tsRisks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.classify402Messagestill distinguishes billing vs rate_limit via existing hints.