@@ -89,7 +89,7 @@ function expectInputProvenance(
|
89 | 89 | } |
90 | 90 | |
91 | 91 | function getAgentCall(index = 0): AgentCallRequest { |
92 | | -const call = agentSpy.mock.calls.at(index)?.[0]; |
| 92 | +const call = agentSpy.mock.calls[index]?.[0]; |
93 | 93 | if (!call) { |
94 | 94 | throw new Error(`Expected agent call at index ${index}`); |
95 | 95 | } |
@@ -2879,7 +2879,7 @@ describe("subagent announce formatting", () => {
|
2879 | 2879 | const childCall = getAgentCall() as { params?: { message?: string } }; |
2880 | 2880 | expect(childCall?.params?.message ?? "").toContain("grandchild final output"); |
2881 | 2881 | |
2882 | | -const parentCall = agentSpy.mock.calls.at(1)?.[0] as { params?: { message?: string } }; |
| 2882 | +const parentCall = getAgentCall(1); |
2883 | 2883 | expect(parentCall?.params?.message ?? "").toContain("child synthesized output from grandchild"); |
2884 | 2884 | }); |
2885 | 2885 | |
@@ -3404,7 +3404,7 @@ describe("subagent announce formatting", () => {
|
3404 | 3404 | expect(parentAnnounced).toBe(true); |
3405 | 3405 | expect(agentSpy).toHaveBeenCalledTimes(2); |
3406 | 3406 | |
3407 | | -const parentCall = agentSpy.mock.calls.at(1)?.[0] as { params?: { message?: string } }; |
| 3407 | +const parentCall = getAgentCall(1); |
3408 | 3408 | expect(parentCall?.params?.message ?? "").toContain("middle synthesized output from A and B"); |
3409 | 3409 | }); |
3410 | 3410 | |
@@ -3620,7 +3620,7 @@ describe("subagent announce formatting", () => {
|
3620 | 3620 | |
3621 | 3621 | const childCall = getAgentCall() as { params?: { message?: string } }; |
3622 | 3622 | expect(childCall?.params?.message ?? "").toContain("grandchild settled output"); |
3623 | | -const parentCall = agentSpy.mock.calls.at(1)?.[0] as { params?: { message?: string } }; |
| 3623 | +const parentCall = getAgentCall(1); |
3624 | 3624 | expect(parentCall?.params?.message ?? "").toContain("child synthesized from grandchild"); |
3625 | 3625 | }); |
3626 | 3626 | }); |
|