fix: guarantee manual subagent spawn sends completion message

This commit is contained in:
Peter Steinberger
2026-02-18 02:45:05 +01:00
parent 5bd95bef5a
commit e2dd827ca4
5 changed files with 35 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { resetSubagentRegistryForTests } from "../../agents/subagent-registry.js";
import type { SpawnSubagentResult } from "../../agents/subagent-spawn.js";
import type { OpenClawConfig } from "../../config/config.js";
import { resetSubagentRegistryForTests } from "../../agents/subagent-registry.js";
const hoisted = vi.hoisted(() => {
const spawnSubagentDirectMock = vi.fn();
@@ -94,6 +94,7 @@ describe("/subagents spawn command", () => {
expect(spawnParams.task).toBe("do the thing");
expect(spawnParams.agentId).toBe("beta");
expect(spawnParams.cleanup).toBe("keep");
expect(spawnParams.expectsCompletionMessage).toBe(true);
expect(spawnCtx.agentSessionKey).toBeDefined();
});