




















@@ -236,39 +236,41 @@ describe("CodexNativeSubagentTaskMirror", () => {
236236},
237237});
238238239-expect(runtime.createRunningTaskRun).toHaveBeenCalledWith(
240-expect.objectContaining({
241-runtime: "subagent",
242-taskKind: "codex-native",
243-sourceId: "codex-thread:child-thread",
244-requesterSessionKey: "agent:main:main",
245-ownerKey: "agent:main:main",
246-scopeKind: "session",
247-runId: "codex-thread:child-thread",
248-label: "Codex subagent",
249-task: "write the proof file",
250-notifyPolicy: "silent",
251-deliveryStatus: "not_applicable",
252-}),
253-);
239+expect(runtime.createRunningTaskRun).toHaveBeenCalledWith({
240+runtime: "subagent",
241+taskKind: "codex-native",
242+sourceId: "codex-thread:child-thread",
243+requesterSessionKey: "agent:main:main",
244+ownerKey: "agent:main:main",
245+scopeKind: "session",
246+runId: "codex-thread:child-thread",
247+label: "Codex subagent",
248+task: "write the proof file",
249+notifyPolicy: "silent",
250+deliveryStatus: "not_applicable",
251+preferMetadata: true,
252+startedAt: 40_000,
253+lastEventAt: 40_000,
254+progressSummary: "Codex native subagent spawned.",
255+});
254256expect(vi.mocked(runtime.createRunningTaskRun).mock.calls.at(0)?.[0]).not.toHaveProperty(
255257"childSessionKey",
256258);
257-expect(runtime.recordTaskRunProgressByRunId).toHaveBeenCalledWith(
258-expect.objectContaining({
259- runId: "codex-thread:child-thread",
260- runtime: "subagent",
261- progressSummary: "Codex native subagent is initializing.",
262- }),
263-);
264-expect(runtime.finalizeTaskRunByRunId).toHaveBeenCalledWith(
265-expect.objectContaining({
266- runId: "codex-thread:child-thread",
267- runtime: "subagent",
268- status: "succeeded",
269- terminalSummary: "done",
270-}),
271-);
259+expect(runtime.recordTaskRunProgressByRunId).toHaveBeenCalledWith({
260+runId: "codex-thread:child-thread",
261+runtime: "subagent",
262+lastEventAt: 40_000,
263+progressSummary: "Codex native subagent is initializing.",
264+});
265+expect(runtime.finalizeTaskRunByRunId).toHaveBeenCalledWith({
266+ runId: "codex-thread:child-thread",
267+runtime: "subagent",
268+status: "succeeded",
269+endedAt: 40_000,
270+lastEventAt: 40_000,
271+progressSummary: "done",
272+terminalSummary: "done",
273+});
272274});
273275274276it("preserves a completed collab agent message when the thread later goes idle", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。