diff --git a/src/agents/pi-embedded-runner/run.ts b/src/agents/pi-embedded-runner/run.ts index 208c76fee48..4a3032ba5eb 100644 --- a/src/agents/pi-embedded-runner/run.ts +++ b/src/agents/pi-embedded-runner/run.ts @@ -1133,12 +1133,15 @@ export async function runEmbeddedPiAgent( timedOut, idleTimedOut, timedOutDuringCompaction, - timedOutDuringToolExecution, sessionIdUsed, sessionFileUsed, lastAssistant: sessionLastAssistant, currentAttemptAssistant, } = attempt; + // Field is optional in the public harness SDK contract; default to + // false here so internal code can rely on a strict boolean. Internal + // embedded-runner attempt sets this explicitly. See #52147. + const timedOutDuringToolExecution = attempt.timedOutDuringToolExecution ?? false; if (sessionIdUsed && sessionIdUsed !== activeSessionId) { activeSessionId = sessionIdUsed; } diff --git a/src/agents/pi-embedded-runner/run/types.ts b/src/agents/pi-embedded-runner/run/types.ts index 81c850eecdf..20cd456ac1c 100644 --- a/src/agents/pi-embedded-runner/run/types.ts +++ b/src/agents/pi-embedded-runner/run/types.ts @@ -62,8 +62,13 @@ export type EmbeddedRunAttemptResult = { * True if the run-level timer fired while at least one tool execution was * still in flight. The LLM had already responded; the timeout is unrelated * to the primary model and must not trigger model fallback. Closes #52147. + * + * Optional for plugin-SDK back-compat: this type is re-exported as + * `AgentHarnessAttemptResult` and third-party harnesses cannot necessarily + * observe in-flight tool state. Treat absent as `false` at the runner + * boundary; internal embedded-runner code always sets it explicitly. */ - timedOutDuringToolExecution: boolean; + timedOutDuringToolExecution?: boolean; promptError: unknown; /** * Identifies which phase produced the promptError.