diff --git a/src/cron/isolated-agent.model-formatting.test.ts b/src/cron/isolated-agent.model-formatting.test.ts index 5232d1349a6..4a7677fd01e 100644 --- a/src/cron/isolated-agent.model-formatting.test.ts +++ b/src/cron/isolated-agent.model-formatting.test.ts @@ -1,5 +1,5 @@ import "./isolated-agent.mocks.js"; -import { beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { loadModelCatalog } from "../agents/model-catalog.js"; import * as modelSelection from "../agents/model-selection.js"; import { runEmbeddedPiAgent } from "../agents/pi-embedded.js"; @@ -11,6 +11,7 @@ import { withTempCronHome, writeSessionStoreEntries, } from "./isolated-agent.test-harness.js"; +import { setupIsolatedAgentTurnMocks } from "./isolated-agent.test-setup.js"; import type { CronJob } from "./types.js"; const withTempHome = withTempCronHome; @@ -126,11 +127,16 @@ async function expectInvalidModel(home: string, model: string) { describe("cron model formatting and precedence edge cases", () => { beforeEach(() => { + setupIsolatedAgentTurnMocks({ fast: true }); vi.spyOn(modelSelection, "resolveThinkingDefault").mockReturnValue("off"); vi.mocked(runEmbeddedPiAgent).mockClear(); vi.mocked(loadModelCatalog).mockResolvedValue([]); }); + afterEach(() => { + vi.unstubAllEnvs(); + }); + // ------ provider/model string splitting ------ describe("parseModelRef formatting", () => { diff --git a/src/secrets/runtime.integration.test.ts b/src/secrets/runtime.integration.test.ts index f39607cbe80..8c16ca0761f 100644 --- a/src/secrets/runtime.integration.test.ts +++ b/src/secrets/runtime.integration.test.ts @@ -289,6 +289,7 @@ describe("secrets runtime snapshot integration", () => { plugins: { entries: { google: { + enabled: true, config: { webSearch: { apiKey: { diff --git a/test/git-hooks-pre-commit.test.ts b/test/git-hooks-pre-commit.test.ts index 018fcce7090..778256e15a0 100644 --- a/test/git-hooks-pre-commit.test.ts +++ b/test/git-hooks-pre-commit.test.ts @@ -30,6 +30,11 @@ describe("git-hooks/pre-commit (integration)", () => { path.join(process.cwd(), "git-hooks", "pre-commit"), path.join(dir, "git-hooks", "pre-commit"), ); + writeFileSync( + path.join(dir, "package.json"), + `${JSON.stringify({ name: "openclaw-pre-commit-test", private: true }, null, 2)}\n`, + "utf8", + ); writeFileSync( path.join(dir, "scripts", "pre-commit", "run-node-tool.sh"), "#!/usr/bin/env bash\nexit 0\n", @@ -49,6 +54,13 @@ describe("git-hooks/pre-commit (integration)", () => { encoding: "utf8", mode: 0o755, }); + writeFileSync(path.join(fakeBinDir, "pnpm"), "#!/usr/bin/env bash\nexit 0\n", { + encoding: "utf8", + mode: 0o755, + }); + writeFileSync(path.join(fakeBinDir, "pnpm.cmd"), "@echo off\r\nexit /b 0\r\n", { + encoding: "utf8", + }); // Create an untracked file that should NOT be staged by the hook. writeFileSync(path.join(dir, "secret.txt"), "do-not-stage\n", "utf8");