fix: summarize AgentRun command output by signal

This commit is contained in:
Codex
2026-06-11 11:00:23 +00:00
parent 9bf56ca5a3
commit fde8499378
2 changed files with 278 additions and 5 deletions
+26
View File
@@ -133,6 +133,30 @@ assertCondition(
"AgentRun logs/events must render payload error, backend phase, and command id summaries by default",
);
assertCondition(
agentRunSource.includes("function commandOutputSummary(payload: Record<string, unknown>): string | null")
&& agentRunSource.includes("function summarizeStructuredCliOutput(value: Record<string, unknown>): string | null")
&& agentRunSource.includes("function parseJsonRecordFromText(raw: string): Record<string, unknown> | null")
&& agentRunSource.includes('if (type === "command_output")')
&& agentRunSource.includes("push(commandOutputSummary(payload))")
&& agentRunSource.includes('if (type !== "command_output")'),
"AgentRun command_output summaries must use a dedicated low-noise renderer instead of raw payload JSON",
);
assertCondition(
agentRunSource.includes("isLowSignalJsonField")
&& agentRunSource.includes('key === "generatedAt" || key === "cli" || key === "version" || key === "valuesRedacted" || key === "secretMaterialStored"')
&& agentRunSource.includes('firstPathText(value, ["action", "operation", "command", "kind"])')
&& agentRunSource.includes('"traceId", "lastTraceId", "trace.traceId", "trace.id", "body.traceId", "body.trace.id", "providerTrace.traceId", "runnerTrace.traceId"')
&& agentRunSource.includes('"sessionId", "session.sessionId", "body.sessionId", "workspace.selectedAgentSessionId", "workspace.selectedConversation.sessionId"')
&& agentRunSource.includes('"conversationId", "session.conversationId", "body.conversationId", "workspace.selectedConversationId", "workspace.selectedConversation.conversationId"')
&& agentRunSource.includes('"providerProfile", "backendProfile", "profile", "session.providerProfile", "workspace.providerProfile"')
&& agentRunSource.includes('"pipelineRun", "pipelineRunName", "pipelineRun.name", "pipeline.runName", "pipeline.name"')
&& agentRunSource.includes("function summarizePartialJsonCommandOutput(raw: string): string | null")
&& agentRunSource.includes("if (failure !== null || isFailureLikeStatus(status))"),
"AgentRun command_output summaries must prefer business fields and suppress metadata-only JSON headers",
);
assertCondition(
agentRunSource.includes("function rerunWithoutDryRun(command: string): string")
&& agentRunSource.includes("options.dryRun ? [rerunWithoutDryRun(command)] : undefined"),
@@ -157,6 +181,8 @@ console.log(JSON.stringify({
"AgentRun resource failure output is visible in human mode",
"AgentRun logs tail is enforced by the render-only client",
"AgentRun logs/events expose payload error and backend phase summaries",
"AgentRun command_output summaries use a dedicated low-noise renderer",
"AgentRun command_output summaries prefer business fields over metadata headers",
"AgentRun dry-run mutations keep resource-command follow-up",
],
}));