diff --git a/plugins/provider-codex/src/translator.test.ts b/plugins/provider-codex/src/translator.test.ts --- a/plugins/provider-codex/src/translator.test.ts +++ b/plugins/provider-codex/src/translator.test.ts @@ -729,5 +729,36 @@ describe("codex subagent activity correlation", () => { const rootProviderThreadId = "root-provider-thread"; + it("links a rawless resumed subagent when its child turn starts", () => { + const harness = createHarness(); + + expect( + harness.translate( + subAgentActivity({ + id: "synthetic-followup-call", + kind: "interacted", + agentThreadId: "synthetic-agent-thread", + }), + ), + ).toEqual([]); + + const events = harness.translate(childTurnStarted("synthetic-child-turn")); + expect(events).toContainEqual( + expect.objectContaining({ + type: "item/started", + item: expect.objectContaining({ + type: "delegation", + childRef: "synthetic-agent-thread", + }), + }), + ); + expect(events).toContainEqual( + expect.objectContaining({ + type: "turn/started", + parentToolCallId: harness.itemId("synthetic-followup-call"), + }), + ); + }); + function subAgentActivity(args: { agentThreadId?: string; id: string;