fix(agents): probe single-provider billing cooldowns#41422
Conversation
Greptile SummaryThis PR correctly fixes the stuck-recovery bug where a single-provider setup in a billing cooldown could never auto-recover. The fix adds a What's verified:
Confidence Score: 5/5
Last reviewed commit: 00e9629 |
91dca00 to
8b6e118
Compare
f96c75e to
bbc4254
Compare
|
Merged via squash.
Thanks @altaywtf! |
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🟡 Billing cooldown bypass via single-provider probing can trigger outbound provider calls during disabled window
DescriptionThe new billing-cooldown probing logic in This is security-relevant in hosted/multi-user deployments where untrusted users can trigger runs using shared provider credentials:
Impact:
Vulnerable code (new branch enabling the probe): if (inferredReason === "billing") {
const shouldProbeSingleProviderBilling =
params.isPrimary &&
!params.hasFallbackCandidates &&
isProbeThrottleOpen(params.now, params.probeThrottleKey);
if (params.isPrimary && (shouldProbe || shouldProbeSingleProviderBilling)) {
return { type: "attempt", reason: inferredReason, markProbe: true };
}
return { type: "skip", ... };
}And the probe option that enables attempting a cooldowned profile: if (decision.reason === "rate_limit" ||
decision.reason === "overloaded" ||
decision.reason === "billing") {
runOptions = { allowTransientCooldownProbe: true };
}RecommendationTreat Options:
Example gating (conceptual): // plumb this from caller context (e.g., senderIsOwner/trigger)
const allowBillingProbe = params.trustedCaller === true;
if (inferredReason === "billing" && !allowBillingProbe) {
return {
type: "skip",
reason: inferredReason,
error: `Provider ${params.candidate.provider} has billing issue (skipping all models)`,
};
}If billing probes are required for recovery, consider probing via a dedicated, low-rate background job rather than user-triggered requests. Analyzed PR: #41422 at commit Last updated on: 2026-03-09T22:34:01Z |
* main: (33 commits) Exec: mark child command env with OPENCLAW_CLI (openclaw#41411) fix(plugins): expose model auth API to context-engine plugins (openclaw#41090) Add HTTP 499 to transient error codes for model fallback (openclaw#41468) Logging: harden probe suppression for observations (openclaw#41338) fix(discord): apply effective maxLinesPerMessage in live replies (openclaw#40133) build(protocol): regenerate Swift models after pending node work schemas (openclaw#41477) Agents: add fallback error observations (openclaw#41337) acp: harden follow-up reliability and attachments (openclaw#41464) fix(agents): probe single-provider billing cooldowns (openclaw#41422) acp: add regression coverage and smoke-test docs (openclaw#41456) acp: forward attachments into ACP runtime sessions (openclaw#41427) acp: enrich streaming updates for ide clients (openclaw#41442) Sandbox: import STATE_DIR from paths directly (openclaw#41439) acp: restore session context and controls (openclaw#41425) acp: fail honestly in bridge mode (openclaw#41424) Gateway: tighten node pending drain semantics (openclaw#41429) Gateway: add pending node work primitives (openclaw#41409) fix(auth): reset cooldown error counters on expiry to prevent infinite escalation (openclaw#41028) fix(cron): do not misclassify empty/NO_REPLY as interim acknowledgement (openclaw#41401) iOS: reconnect gateway on foreground return (openclaw#41384) ...
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf
Merged via squash. Prepared head SHA: bbc4254 Co-authored-by: altaywtf <[email protected]> Co-authored-by: altaywtf <[email protected]> Reviewed-by: @altaywtf (cherry picked from commit 0669b0d)
Summary
openclaw gateway restart, even after the user tops up credits.billingand there are no fallback candidates.rate_limitorauth; fallback-bearing providers still keep the near-expiry probe behavior.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Single-provider billing cooldowns can now recover automatically on the normal probe throttle after credits are restored, instead of staying stuck until a gateway restart.
Security Impact (required)
No)No)No)No)No)Repro + Verification
Environment
Steps
billingcooldown state.Expected
gateway restart.Actual
All models failed.Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
billing.Review Conversations
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
00e96296csrc/agents/model-fallback.ts,src/agents/model-fallback.probe.test.tsRisks and Mitigations
billingonly.