






















@@ -262,11 +262,9 @@ describe("sendControlledSubagentMessage", () => {
262262message: "continue",
263263});
264264265-expect(result).toEqual({
266-status: "error",
267-runId: expect.any(String),
268-error: "gateway unavailable",
269-});
265+expect(result.status).toBe("error");
266+expect(typeof result.runId).toBe("string");
267+expect(result.error).toBe("gateway unavailable");
270268});
271269272270it("does not send to a newer live run when the caller passes a stale run entry", async () => {
@@ -557,12 +555,10 @@ describe("killSubagentRunAdmin", () => {
557555sessionKey: childSessionKey,
558556});
559557560-expect(result).toMatchObject({
561-found: true,
562-killed: true,
563-runId: "run-worker",
564-sessionKey: childSessionKey,
565-});
558+expect(result.found).toBe(true);
559+expect(result.killed).toBe(true);
560+expect(result.runId).toBe("run-worker");
561+expect(result.sessionKey).toBe(childSessionKey);
566562expect(getSubagentRunByChildSessionKey(childSessionKey)?.endedAt).toBeTypeOf("number");
567563});
568564@@ -608,12 +604,10 @@ describe("killSubagentRunAdmin", () => {
608604sessionKey: childSessionKey,
609605});
610606611-expect(result).toMatchObject({
612-found: true,
613-killed: false,
614-runId: "run-current-admin",
615-sessionKey: childSessionKey,
616-});
607+expect(result.found).toBe(true);
608+expect(result.killed).toBe(false);
609+expect(result.runId).toBe("run-current-admin");
610+expect(result.sessionKey).toBe(childSessionKey);
617611});
618612619613it("still terminates the run when session store persistence fails during kill", async () => {
@@ -648,12 +642,10 @@ describe("killSubagentRunAdmin", () => {
648642sessionKey: childSessionKey,
649643});
650644651-expect(result).toMatchObject({
652-found: true,
653-killed: true,
654-runId: "run-worker-store-fail",
655-sessionKey: childSessionKey,
656-});
645+expect(result.found).toBe(true);
646+expect(result.killed).toBe(true);
647+expect(result.runId).toBe("run-worker-store-fail");
648+expect(result.sessionKey).toBe(childSessionKey);
657649expect(getSubagentRunByChildSessionKey(childSessionKey)?.endedAt).toBeTypeOf("number");
658650});
659651});
@@ -1232,10 +1224,9 @@ describe("steerControlledSubagentRun", () => {
12321224sessionId: undefined,
12331225error: "failed to replace steered subagent run",
12341226});
1235-expect(getSubagentRunByChildSessionKey("agent:main:subagent:steer-worker")).toMatchObject({
1236-runId: "run-steer-old",
1237-suppressAnnounceReason: undefined,
1238-});
1227+const storedRun = getSubagentRunByChildSessionKey("agent:main:subagent:steer-worker");
1228+expect(storedRun?.runId).toBe("run-steer-old");
1229+expect(storedRun?.suppressAnnounceReason).toBeUndefined();
12391230} finally {
12401231replaceSpy.mockRestore();
12411232}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。