This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/agents/pi-embedded-runner/run.ts b/src/agents/pi-embedded-runner/run.ts | |
| index 4d13eff..481f516 100644 | |
| --- a/src/agents/pi-embedded-runner/run.ts | |
| +++ b/src/agents/pi-embedded-runner/run.ts | |
| @@ -425,6 +425,32 @@ export async function runEmbeddedPiAgent( | |
| // Hoisted so the retry-limit error path can use the most recent API total. | |
| let lastTurnTotal: number | undefined; | |
| while (true) { | |
| + // ── SENTINEL LEASE: Check authority before each iteration ── | |
| + try { |