mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 03:04:32 +00:00
Tests: skip OpenRouter failure cooldown persistence
This commit is contained in:
@@ -26,6 +26,11 @@ async function withAuthProfileStore(
|
|||||||
provider: "anthropic",
|
provider: "anthropic",
|
||||||
key: "sk-default",
|
key: "sk-default",
|
||||||
},
|
},
|
||||||
|
"openrouter:default": {
|
||||||
|
type: "api_key",
|
||||||
|
provider: "openrouter",
|
||||||
|
key: "sk-or-default",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -152,6 +157,29 @@ describe("markAuthProfileFailure", () => {
|
|||||||
fs.rmSync(agentDir, { recursive: true, force: true });
|
fs.rmSync(agentDir, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("does not persist cooldown windows for OpenRouter profiles", async () => {
|
||||||
|
await withAuthProfileStore(async ({ agentDir, store }) => {
|
||||||
|
await markAuthProfileFailure({
|
||||||
|
store,
|
||||||
|
profileId: "openrouter:default",
|
||||||
|
reason: "rate_limit",
|
||||||
|
agentDir,
|
||||||
|
});
|
||||||
|
|
||||||
|
await markAuthProfileFailure({
|
||||||
|
store,
|
||||||
|
profileId: "openrouter:default",
|
||||||
|
reason: "billing",
|
||||||
|
agentDir,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(store.usageStats?.["openrouter:default"]).toBeUndefined();
|
||||||
|
|
||||||
|
const reloaded = ensureAuthProfileStore(agentDir);
|
||||||
|
expect(reloaded.usageStats?.["openrouter:default"]).toBeUndefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("calculateAuthProfileCooldownMs", () => {
|
describe("calculateAuthProfileCooldownMs", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user