mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 08:31:55 +00:00
fix: escalate to model fallback after rate-limit profile rotation cap (#58707)
* fix: escalate to model fallback after rate-limit profile rotation cap Per-model rate limits (e.g. Anthropic Sonnet-only quotas) are not relieved by rotating auth profiles — if all profiles share the same model quota, cycling between them loops forever without falling back to the next model in the configured fallbacks chain. Apply the same rotation-cap pattern introduced for overloaded_error (#58348) to rate_limit errors: - Add `rateLimitedProfileRotations` to auth.cooldowns config (default: 1) - After N profile rotations on a rate_limit error, throw FailoverError to trigger cross-provider model fallback - Add `resolveRateLimitProfileRotationLimit` helper following the same pattern as `resolveOverloadProfileRotationLimit` Fixes #58572 * fix: cap prompt-side rate-limit failover (#58707) (thanks @Forgely3D) * fix: restore latest-main gates for #58707 --------- Co-authored-by: Ember (Forgely3D) <ember@forgely.co> Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -6,9 +6,9 @@ const TASK_ROOT = path.resolve(import.meta.dirname);
|
||||
const SRC_ROOT = path.resolve(TASK_ROOT, "..");
|
||||
|
||||
const ALLOWED_IMPORTERS = new Set([
|
||||
"auto-reply/reply/commands-status.ts",
|
||||
"tasks/runtime-internal.ts",
|
||||
"tasks/task-owner-access.ts",
|
||||
"tasks/task-status-access.ts",
|
||||
]);
|
||||
|
||||
async function listSourceFiles(root: string): Promise<string[]> {
|
||||
|
||||
10
src/tasks/task-status-access.ts
Normal file
10
src/tasks/task-status-access.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { listTasksForAgentId, listTasksForSessionKey } from "./task-registry.js";
|
||||
import type { TaskRecord } from "./task-registry.types.js";
|
||||
|
||||
export function listTasksForSessionKeyForStatus(sessionKey: string): TaskRecord[] {
|
||||
return listTasksForSessionKey(sessionKey);
|
||||
}
|
||||
|
||||
export function listTasksForAgentIdForStatus(agentId: string): TaskRecord[] {
|
||||
return listTasksForAgentId(agentId);
|
||||
}
|
||||
Reference in New Issue
Block a user