|
4 | 4 | embeddedAgentLog, |
5 | 5 | finalizeHarnessContextEngineTurn, |
6 | 6 | formatErrorMessage, |
7 | | - hasCompletedSourceReplyDeliveryEvidence, |
8 | 7 | resolveContextEngineOwnerPluginId, |
9 | 8 | runAgentHarnessLlmOutputHook, |
10 | 9 | runHarnessContextEngineMaintenance, |
@@ -47,6 +46,12 @@ import { |
47 | 46 | refreshCodexUsageLimitPromptError, |
48 | 47 | } from "./usage-limit-error.js"; |
49 | 48 |
|
| 49 | +function hasCompletedCodexSourceReplyDelivery(result: EmbeddedRunAttemptResult): boolean { |
| 50 | + return [result.messagingToolSentTargets, result.messagingToolSourceReplyPayloads].some( |
| 51 | + (entries) => entries?.some((entry) => entry.sourceReplyFinal === true), |
| 52 | + ); |
| 53 | +} |
| 54 | + |
50 | 55 | export async function finalizeCodexAttempt( |
51 | 56 | resources: CodexAttemptResources, |
52 | 57 | turnRuntime: CodexAttemptTurnState, |
@@ -285,7 +290,7 @@ export async function finalizeCodexAttempt( |
285 | 290 | (completedTurnStatus === "completed" || recoveredTurnWatchTimeout || locallyCompletedTurn); |
286 | 291 | // buildResult retains canonical source-delivery markers. Tool-only visible |
287 | 292 | // output must clear an otherwise stale empty/reasoning-only classification. |
288 | | - const completedSourceReply = turnSucceeded && hasCompletedSourceReplyDeliveryEvidence(result); |
| 293 | + const completedSourceReply = turnSucceeded && hasCompletedCodexSourceReplyDelivery(result); |
289 | 294 | if (completedSourceReply) { |
290 | 295 | // Harness classification only sees assistant/reasoning/plan projections. |
291 | 296 | // A reply delivered entirely through the source message tool is visible |
|
0 commit comments