chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -20,10 +20,7 @@ function makeCfg(overrides: Partial<ClawdbotConfig> = {}): ClawdbotConfig {
describe("runWithModelFallback", () => {
it("does not fall back on non-auth errors", async () => {
const cfg = makeCfg();
const run = vi
.fn()
.mockRejectedValueOnce(new Error("bad request"))
.mockResolvedValueOnce("ok");
const run = vi.fn().mockRejectedValueOnce(new Error("bad request")).mockResolvedValueOnce("ok");
await expect(
runWithModelFallback({
@@ -60,9 +57,7 @@ describe("runWithModelFallback", () => {
const cfg = makeCfg();
const run = vi
.fn()
.mockRejectedValueOnce(
Object.assign(new Error("payment required"), { status: 402 }),
)
.mockRejectedValueOnce(Object.assign(new Error("payment required"), { status: 402 }))
.mockResolvedValueOnce("ok");
const result = await runWithModelFallback({
@@ -106,9 +101,7 @@ describe("runWithModelFallback", () => {
const cfg = makeCfg();
const run = vi
.fn()
.mockRejectedValueOnce(
new Error('No credentials found for profile "anthropic:claude-cli".'),
)
.mockRejectedValueOnce(new Error('No credentials found for profile "anthropic:claude-cli".'))
.mockResolvedValueOnce("ok");
const result = await runWithModelFallback({
@@ -136,9 +129,7 @@ describe("runWithModelFallback", () => {
});
const run = vi
.fn()
.mockImplementation(() =>
Promise.reject(Object.assign(new Error("nope"), { status: 401 })),
);
.mockImplementation(() => Promise.reject(Object.assign(new Error("nope"), { status: 401 })));
await expect(
runWithModelFallback({
@@ -219,9 +210,7 @@ describe("runWithModelFallback", () => {
}),
).rejects.toThrow("primary failed");
expect(calls).toEqual([
{ provider: "anthropic", model: "claude-opus-4-5" },
]);
expect(calls).toEqual([{ provider: "anthropic", model: "claude-opus-4-5" }]);
});
it("falls back on missing API key errors", async () => {
@@ -277,9 +266,7 @@ describe("runWithModelFallback", () => {
});
const run = vi
.fn()
.mockRejectedValueOnce(
Object.assign(new Error("timeout"), { code: "ETIMEDOUT" }),
)
.mockRejectedValueOnce(Object.assign(new Error("timeout"), { code: "ETIMEDOUT" }))
.mockResolvedValueOnce("ok");
const result = await runWithModelFallback({