mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
Tests: skip OpenRouter failure cooldown persistence
This commit is contained in:
@@ -26,6 +26,11 @@ async function withAuthProfileStore(
|
||||
provider: "anthropic",
|
||||
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 });
|
||||
}
|
||||
});
|
||||
|
||||
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", () => {
|
||||
|
||||
Reference in New Issue
Block a user