From ef98a8dd49e5a83f5a4af6514adc1a5660ad775b Mon Sep 17 00:00:00 2001 From: Ayaan Zaidi Date: Sun, 12 Apr 2026 09:23:39 +0530 Subject: [PATCH] refactor(agents): trim bootstrap marker gate --- .../run/attempt.spawn-workspace.bootstrap-marker.test.ts | 6 ------ src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts | 3 --- src/agents/pi-embedded-runner/run/attempt.ts | 6 ------ 3 files changed, 15 deletions(-) diff --git a/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-marker.test.ts b/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-marker.test.ts index a6a59d64f3f..8a70f7e8e07 100644 --- a/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-marker.test.ts +++ b/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-marker.test.ts @@ -8,7 +8,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => { shouldRecordCompletedBootstrapTurn: true, promptError: undefined, aborted: false, - yieldAborted: true, timedOutDuringCompaction: false, compactionOccurredThisAttempt: false, }), @@ -21,7 +20,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => { shouldRecordCompletedBootstrapTurn: false, promptError: undefined, aborted: false, - yieldAborted: false, timedOutDuringCompaction: false, compactionOccurredThisAttempt: false, }), @@ -34,7 +32,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => { shouldRecordCompletedBootstrapTurn: true, promptError: undefined, aborted: true, - yieldAborted: false, timedOutDuringCompaction: false, compactionOccurredThisAttempt: false, }), @@ -47,7 +44,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => { shouldRecordCompletedBootstrapTurn: true, promptError: new Error("prompt failed"), aborted: false, - yieldAborted: false, timedOutDuringCompaction: false, compactionOccurredThisAttempt: false, }), @@ -58,7 +54,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => { shouldRecordCompletedBootstrapTurn: true, promptError: undefined, aborted: false, - yieldAborted: false, timedOutDuringCompaction: true, compactionOccurredThisAttempt: false, }), @@ -69,7 +64,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => { shouldRecordCompletedBootstrapTurn: true, promptError: undefined, aborted: false, - yieldAborted: false, timedOutDuringCompaction: false, compactionOccurredThisAttempt: true, }), diff --git a/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts b/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts index 8fafed3a557..2a6bdb68b63 100644 --- a/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts +++ b/src/agents/pi-embedded-runner/run/attempt.thread-helpers.ts @@ -93,7 +93,6 @@ export function shouldPersistCompletedBootstrapTurn(params: { shouldRecordCompletedBootstrapTurn: boolean; promptError: unknown; aborted: boolean; - yieldAborted: boolean; timedOutDuringCompaction: boolean; compactionOccurredThisAttempt: boolean; }): boolean { @@ -103,7 +102,5 @@ export function shouldPersistCompletedBootstrapTurn(params: { if (params.timedOutDuringCompaction || params.compactionOccurredThisAttempt) { return false; } - // Intentionally allow clean sessions_yield exits here so continuation-skip - // can treat the next relay/user turn as an existing bootstrap session. return true; } diff --git a/src/agents/pi-embedded-runner/run/attempt.ts b/src/agents/pi-embedded-runner/run/attempt.ts index 6e1d0bc8c54..cca25d098c4 100644 --- a/src/agents/pi-embedded-runner/run/attempt.ts +++ b/src/agents/pi-embedded-runner/run/attempt.ts @@ -1946,9 +1946,6 @@ export async function runEmbeddedAttempt( } } } catch (err) { - // Yield-triggered abort is intentional — treat as clean stop, not error. - // Check the abort reason to distinguish from external aborts (timeout, user cancel) - // that may race after yieldDetected is set. yieldAborted = yieldDetected && isRunnerAbortError(err) && @@ -1956,8 +1953,6 @@ export async function runEmbeddedAttempt( err.cause === "sessions_yield"; if (yieldAborted) { aborted = false; - // Ensure the session abort has mostly settled before proceeding, but - // don't deadlock the whole run if the underlying session abort hangs. await waitForSessionsYieldAbortSettle({ settlePromise: yieldAbortSettled, runId: params.runId, @@ -2174,7 +2169,6 @@ export async function runEmbeddedAttempt( shouldRecordCompletedBootstrapTurn, promptError, aborted, - yieldAborted, timedOutDuringCompaction, compactionOccurredThisAttempt, })