Skip to content

Commit 0f0787a

Browse files
committed
fix: keep session lock teardown comment lean
1 parent 90ded86 commit 0f0787a

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

src/agents/pi-embedded-runner/run/attempt.session-lock.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,6 @@ export type EmbeddedAttemptSessionLockController = {
630630
): Promise<T>;
631631
acquireForCleanup(params?: { session?: unknown }): Promise<SessionLock>;
632632
hasSessionTakeover(): boolean;
633-
/**
634-
* Force-release the eagerly-held session lock if it is still retained. Idempotent and safe
635-
* to call from a run's outer `finally`: the happy path hands the lock to `acquireForCleanup`
636-
* (so this is a no-op), but an exception on the post-prompt path can skip cleanup entirely,
637-
* which would otherwise leak the lock to the live process until the watchdog reclaims it.
638-
*/
639633
dispose(): Promise<void>;
640634
};
641635

src/agents/pi-embedded-runner/run/attempt.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,10 +1272,7 @@ export async function runEmbeddedAttempt(
12721272
| undefined;
12731273
let beforeAgentRunBlocked = false;
12741274
let beforeAgentRunBlockedBy: string | undefined;
1275-
// Set once the session lock controller exists, so the outer finally can always release the
1276-
// eagerly-held session lock even when an exception on the post-prompt path skips the cleanup
1277-
// block below (#86014). The cleanup block hands the lock off on normal/aborted paths, so this
1278-
// is a no-op then.
1275+
// Releases the eager session lock if post-prompt code exits before cleanup.
12791276
let releaseRetainedSessionLock: (() => Promise<void>) | undefined;
12801277
try {
12811278
const skillsSnapshotForRun =
@@ -5039,10 +5036,6 @@ export async function runEmbeddedAttempt(
50395036
}
50405037
}
50415038
} finally {
5042-
// Guarantee the eagerly-held session write lock is released on every exit path. The cleanup
5043-
// block above hands it to acquireForCleanup on normal/aborted/timed-out runs (so this is a
5044-
// no-op then), but an exception thrown in post-prompt processing skips that block and would
5045-
// otherwise leak the lock to the live gateway process until the watchdog reclaims it (#86014).
50465039
try {
50475040
await releaseRetainedSessionLock?.();
50485041
} catch (releaseErr) {

0 commit comments

Comments
 (0)