






















@@ -636,6 +636,65 @@ describe("runCodexAppServerAttempt", () => {
636636);
637637});
638638639+it("forwards Codex app-server verbose tool summaries and completed output", async () => {
640+const onToolResult = vi.fn();
641+const sessionFile = path.join(tempDir, "session.jsonl");
642+const workspaceDir = path.join(tempDir, "workspace");
643+const harness = createStartedThreadHarness();
644+const params = createParams(sessionFile, workspaceDir);
645+params.verboseLevel = "full";
646+params.onToolResult = onToolResult;
647+648+const run = runCodexAppServerAttempt(params);
649+await harness.waitForMethod("turn/start");
650+await harness.notify({
651+method: "item/started",
652+params: {
653+threadId: "thread-1",
654+turnId: "turn-1",
655+item: {
656+type: "dynamicToolCall",
657+id: "tool-1",
658+namespace: null,
659+tool: "read",
660+arguments: { path: "README.md" },
661+status: "inProgress",
662+contentItems: null,
663+success: null,
664+durationMs: null,
665+},
666+},
667+});
668+await harness.notify({
669+method: "item/completed",
670+params: {
671+threadId: "thread-1",
672+turnId: "turn-1",
673+item: {
674+type: "dynamicToolCall",
675+id: "tool-1",
676+namespace: null,
677+tool: "read",
678+arguments: { path: "README.md" },
679+status: "completed",
680+contentItems: [{ type: "inputText", text: "file contents" }],
681+success: true,
682+durationMs: 12,
683+},
684+},
685+});
686+await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });
687+await run;
688+689+expect(onToolResult).toHaveBeenCalledTimes(2);
690+expect(onToolResult).toHaveBeenNthCalledWith(1, {
691+text: "📖 Read: `from README.md`",
692+});
693+expect(onToolResult).toHaveBeenNthCalledWith(2, {
694+text: "📖 Read: `from README.md`\n```txt\nfile contents\n```",
695+});
696+});
697+639698it("registers native hook relay config for an enabled Codex turn and cleans it up", async () => {
640699const sessionFile = path.join(tempDir, "session.jsonl");
641700const workspaceDir = path.join(tempDir, "workspace");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。