


























@@ -20,6 +20,7 @@ import {
2020type CodexAppServerEventProjectorOptions,
2121type CodexAppServerToolTelemetry,
2222} from "./event-projector.js";
23+import { CodexNativeSubagentTaskMirror } from "./native-subagent-task-mirror.js";
2324import { rememberCodexRateLimits, resetCodexRateLimitCacheForTests } from "./rate-limit-cache.js";
2425import { createCodexTestModel } from "./test-support.js";
2526@@ -643,6 +644,36 @@ describe("CodexAppServerEventProjector", () => {
643644expect(result.assistantTexts).toStrictEqual([]);
644645});
645646647+it("mirrors native subagent notifications before current-turn filtering", async () => {
648+const projector = await createProjector({
649+ ...(await createParams()),
650+sessionKey: "agent:main:main",
651+} as EmbeddedRunAttemptParams);
652+const mirrorSpy = vi.spyOn(CodexNativeSubagentTaskMirror.prototype, "handleNotification");
653+const notification = {
654+method: "item/completed",
655+params: {
656+threadId: THREAD_ID,
657+turnId: "child-turn",
658+item: {
659+type: "collabAgentToolCall",
660+tool: "spawnAgent",
661+senderThreadId: THREAD_ID,
662+receiverThreadIds: ["child-thread"],
663+agentsStates: {
664+"child-thread": { status: "completed", message: "done" },
665+},
666+},
667+},
668+} as ProjectorNotification;
669+670+await projector.handleNotification(notification);
671+672+expect(mirrorSpy).toHaveBeenCalledWith(notification);
673+const result = projector.buildResult(buildEmptyToolTelemetry());
674+expect(result.assistantTexts).toEqual([]);
675+});
676+646677it("ignores notifications that omit top-level thread and turn ids", async () => {
647678const projector = await createProjector();
648679此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。