Skip to content

Commit e14edf8

Browse files
committed
docs: document co-tenant epoch trade-off in session fence
1 parent 352b46b commit e14edf8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,14 @@ export async function createEmbeddedAttemptSessionLockController(params: {
293293
}
294294
const currentEpoch = getSessionWriteEpoch(params.lockOptions.sessionFile);
295295
if (currentEpoch > fenceWriteEpoch + 1) {
296+
// Epoch advanced by more than our own reacquire — at least one other
297+
// in-process lock holder (heartbeat, cron, channel) wrote during the
298+
// prompt I/O window. Accept the change and re-baseline.
299+
//
300+
// Trade-off: an external lock-bypassing write in the same window would
301+
// also be accepted. This is intentional — external bypasses already
302+
// violate the lock contract, and rejecting co-tenant writes would
303+
// recreate the session-stall regression (#84071).
296304
fenceFingerprint = current;
297305
fenceWriteEpoch = currentEpoch;
298306
return;

0 commit comments

Comments
 (0)