test(subagents): use lightweight clears in sessions spawn suites

This commit is contained in:
Peter Steinberger
2026-02-22 08:27:29 +00:00
parent 8887f41d7d
commit c7606e7064
5 changed files with 5 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ describe("sessions tools", () => {
});
beforeEach(() => {
callGatewayMock.mockReset();
callGatewayMock.mockClear();
});
it("uses number (not integer) in tool schemas for Gemini compatibility", () => {

View File

@@ -69,7 +69,7 @@ function seedDepthTwoAncestryStore(params?: { sessionIds?: boolean }) {
describe("sessions_spawn depth + child limits", () => {
beforeEach(() => {
resetSubagentRegistryForTests();
callGatewayMock.mockReset();
callGatewayMock.mockClear();
storeTemplatePath = path.join(
os.tmpdir(),
`openclaw-subagent-depth-${Date.now()}-${Math.random().toString(16).slice(2)}-{agentId}.json`,

View File

@@ -76,7 +76,7 @@ describe("openclaw-tools: subagents (sessions_spawn allowlist)", () => {
beforeEach(() => {
resetSessionsSpawnConfigOverride();
resetSubagentRegistryForTests();
callGatewayMock.mockReset();
callGatewayMock.mockClear();
});
it("sessions_spawn only allows same-agent by default", async () => {

View File

@@ -151,7 +151,7 @@ describe("openclaw-tools: subagents (sessions_spawn lifecycle)", () => {
beforeEach(() => {
resetSessionsSpawnConfigOverride();
resetSubagentRegistryForTests();
callGatewayMock.mockReset();
callGatewayMock.mockClear();
});
it("sessions_spawn runs cleanup flow after subagent completion", async () => {

View File

@@ -100,7 +100,7 @@ describe("openclaw-tools: subagents (sessions_spawn model + thinking)", () => {
beforeEach(() => {
resetSessionsSpawnConfigOverride();
resetSubagentRegistryForTests();
callGatewayMock.mockReset();
callGatewayMock.mockClear();
});
it("sessions_spawn applies a model to the child session", async () => {