fix(tests): settle subagent steer work before teardown (#155888)

Join the existing registry settlement boundary before resetting announcement
mocks and registry state. The real requester-wake imports otherwise retain
Gateway roots across fixture teardown and can fail the following suite.

A direct ownership trace changed from eight unfinished wake imports and
22 cleanup boundaries with active roots to all imports joined and zero
remaining roots. Production scheduling and cancellation are unchanged.
This commit is contained in:
Peter Steinberger
2026-09-22 12:56:42 -07:00
committed by GitHub
parent ff627aa5b8
commit f0d26603a5
@@ -13,6 +13,7 @@ import {
} from "../../../tasks/task-runtime.test-helpers.js";
import { subagentRuns } from "./subagent-registry-memory.js";
import { persistSubagentRunsToDiskOrThrow } from "./subagent-registry-state.js";
import { settleSubagentRegistryPersistenceWork } from "./subagent-registry.persistence.test-support.js";
const noop = () => {};
let lifecycleHandler:
@@ -353,6 +354,7 @@ describe("subagent registry steer restarts", () => {
afterEach(async () => {
vi.useRealTimers();
await settleSubagentRegistryPersistenceWork();
announceSpy.mockReset();
announceSpy.mockResolvedValue("delivered");
runSubagentEndedHookMock.mockReset();