diff --git a/src/agents/embedded-agent-runner/run.inherited-auth-owner.test.ts b/src/agents/embedded-agent-runner/run.inherited-auth-owner.test.ts index a250b307bd4b..63703dd26bcb 100644 --- a/src/agents/embedded-agent-runner/run.inherited-auth-owner.test.ts +++ b/src/agents/embedded-agent-runner/run.inherited-auth-owner.test.ts @@ -1,5 +1,5 @@ import path from "node:path"; -import { describe, expect, it } from "vitest"; +import { beforeEach, describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import { listAgentIds } from "../agent-scope-config.js"; import { makeAttemptResult } from "./run.overflow-compaction.fixture.js"; @@ -9,8 +9,11 @@ import { mockedBuildEmbeddedRunPayloads, mockedRunEmbeddedAttempt, overflowBaseRunParams, + resetSharedRunIntegrationHarnessMocks, } from "./run.overflow-compaction.harness.js"; +const { runEmbeddedAgent } = await loadRunOverflowCompactionHarness(); + function projectSetupExecutionConfig(source: OpenClawConfig): OpenClawConfig { return { ...source, @@ -25,6 +28,8 @@ function projectSetupExecutionConfig(source: OpenClawConfig): OpenClawConfig { } describe("embedded setup inference inherited auth owner", () => { + beforeEach(resetSharedRunIntegrationHarnessMocks); + it.each([ { name: "a pre-roster config", source: {} }, { name: "a sole-agent config", source: { agents: { entries: { main: {} } } } }, @@ -34,7 +39,6 @@ describe("embedded setup inference inherited auth owner", () => { const config = projectSetupExecutionConfig(source); expect(listAgentIds(config)).toEqual(["main", "openclaw"]); - const { runEmbeddedAgent } = await loadRunOverflowCompactionHarness(); mockedBuildEmbeddedRunPayloads.mockReturnValue([{ text: "OK" }]); mockedRunEmbeddedAttempt.mockResolvedValueOnce(makeAttemptResult({ assistantTexts: ["OK"] }));