




















@@ -66,7 +66,11 @@ import {
6666resolveCodexPluginAppCacheEndpoint,
6767} from "./plugin-app-cache-key.js";
6868import { buildCodexPluginThreadConfig } from "./plugin-thread-config.js";
69-import type { CodexDynamicToolCallParams, CodexServerNotification } from "./protocol.js";
69+import type {
70+CodexDynamicToolCallParams,
71+CodexDynamicToolCallResponse,
72+CodexServerNotification,
73+} from "./protocol.js";
7074import {
7175readRecentCodexRateLimits,
7276rememberCodexRateLimits,
@@ -3276,6 +3280,32 @@ describe("runCodexAppServerAttempt", () => {
32763280expect(activeDiagnosticToolKeys(diagnosticEvents)).toEqual(new Set());
32773281});
327832823283+it("keeps async-start metadata on internal dynamic tool progress only", () => {
3284+const response: CodexDynamicToolCallResponse = {
3285+contentItems: [{ type: "inputText", text: "Background task started." }],
3286+success: true,
3287+};
3288+Object.defineProperty(response, "asyncStarted", {
3289+configurable: true,
3290+enumerable: false,
3291+value: true,
3292+});
3293+3294+const protocolResponse = testing.toCodexDynamicToolProtocolResponse(response);
3295+const progressResponse = testing.toCodexDynamicToolProgressResponse(response, protocolResponse);
3296+3297+expect(protocolResponse).toEqual({
3298+contentItems: [{ type: "inputText", text: "Background task started." }],
3299+success: true,
3300+});
3301+expect(Object.keys(protocolResponse)).not.toContain("asyncStarted");
3302+expect(progressResponse).toEqual({
3303+contentItems: [{ type: "inputText", text: "Background task started." }],
3304+details: { async: true, status: "started" },
3305+success: true,
3306+});
3307+});
3308+32793309it("clears dynamic tool diagnostics after successful terminal responses", async () => {
32803310const diagnosticEvents: DiagnosticEventPayload[] = [];
32813311const unsubscribeDiagnostics = onInternalDiagnosticEvent((event) =>
@@ -3990,6 +4020,7 @@ describe("runCodexAppServerAttempt", () => {
39904020projector.recordDynamicToolResult({
39914021callId: call.callId,
39924022tool: call.tool,
4023+asyncStarted: toolResult.asyncStarted === true,
39934024success: toolResult.success,
39944025terminalType: toolResult.diagnosticTerminalType ?? "completed",
39954026sideEffectEvidence: toolResult.sideEffectEvidence === true,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。