


























@@ -281,7 +281,7 @@ describe("runCliAgent spawn path", () => {
281281};
282282await executePreparedCliRun(context);
283283284-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as { argv?: string[] };
284+const input = mockCallArg(supervisorSpawnMock) as { argv?: string[] };
285285const allArgs = (input.argv ?? []).join("\n");
286286expect(allArgs).not.toContain("Tools are disabled in this session");
287287expect(allArgs).toContain("You are a helpful assistant.");
@@ -331,7 +331,7 @@ describe("runCliAgent spawn path", () => {
331331}),
332332);
333333334-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
334+const input = mockCallArg(supervisorSpawnMock) as {
335335argv?: string[];
336336input?: string;
337337};
@@ -383,7 +383,7 @@ describe("runCliAgent spawn path", () => {
383383}),
384384);
385385386-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
386+const input = mockCallArg(supervisorSpawnMock) as {
387387argv?: string[];
388388input?: string;
389389mode?: string;
@@ -415,7 +415,7 @@ describe("runCliAgent spawn path", () => {
415415expect(resolveArgsInput.thinkingLevel).toBe("high");
416416expect(resolveArgsInput.useResume).toBe(false);
417417expect(resolveArgsInput.baseArgs).toEqual(["-p", "--output-format", "stream-json"]);
418-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as { argv?: string[] };
418+const input = mockCallArg(supervisorSpawnMock) as { argv?: string[] };
419419expect(requireArgAfter(input.argv, "--effort")).toBe("high");
420420});
421421@@ -655,7 +655,7 @@ describe("runCliAgent spawn path", () => {
655655const result = await executePreparedCliRun(context, "thread-123");
656656657657expect(result.text).toBe("ok");
658-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
658+const input = mockCallArg(supervisorSpawnMock) as {
659659argv?: string[];
660660mode?: string;
661661timeoutMs?: number;
@@ -917,7 +917,7 @@ describe("runCliAgent spawn path", () => {
917917}),
918918);
919919920-const spawnInput = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
920+const spawnInput = mockCallArg(supervisorSpawnMock) as {
921921argv?: string[];
922922stdinMode?: string;
923923};
@@ -2162,7 +2162,7 @@ describe("runCliAgent spawn path", () => {
21622162"thread-123",
21632163);
216421642165-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
2165+const input = mockCallArg(supervisorSpawnMock) as {
21662166env?: Record<string, string | undefined>;
21672167};
21682168expect(input.env?.SAFE_KEY).toBe("ok");
@@ -2190,7 +2190,7 @@ describe("runCliAgent spawn path", () => {
21902190"thread-123",
21912191);
219221922193-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
2193+const input = mockCallArg(supervisorSpawnMock) as {
21942194env?: Record<string, string | undefined>;
21952195};
21962196expect(input.env?.SAFE_KEEP).toBe("keep-me");
@@ -2214,7 +2214,7 @@ describe("runCliAgent spawn path", () => {
22142214"thread-123",
22152215);
221622162217-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
2217+const input = mockCallArg(supervisorSpawnMock) as {
22182218env?: Record<string, string | undefined>;
22192219};
22202220expect(input.env?.SAFE_CLEAR).toBe("from-base");
@@ -2243,7 +2243,7 @@ describe("runCliAgent spawn path", () => {
22432243"thread-123",
22442244);
224522452246-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
2246+const input = mockCallArg(supervisorSpawnMock) as {
22472247env?: Record<string, string | undefined>;
22482248};
22492249expect(input.env?.SAFE_OVERRIDE).toBe("from-override");
@@ -2299,7 +2299,7 @@ describe("runCliAgent spawn path", () => {
22992299}),
23002300);
230123012302-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
2302+const input = mockCallArg(supervisorSpawnMock) as {
23032303env?: Record<string, string | undefined>;
23042304};
23052305expect(input.env?.SAFE_KEEP).toBe("ok");
@@ -2369,7 +2369,7 @@ describe("runCliAgent spawn path", () => {
2369236923702370await executePreparedCliRun(context, "thread-123");
237123712372-const input = supervisorSpawnMock.mock.calls.at(0)?.[0] as {
2372+const input = mockCallArg(supervisorSpawnMock) as {
23732373argv?: string[];
23742374input?: string;
23752375};
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。