@monotykamary/pi-retry 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/retry.ts +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-retry",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Extension suite for pi coding agent that handles 400/413 errors and connection errors with automatic retry",
5
5
  "type": "module",
6
6
  "author": "Tom X Nguyen",
package/retry.ts CHANGED
@@ -355,10 +355,16 @@ export default function (pi: ExtensionAPI) {
355
355
  // finishRun() after agent_end listeners return).
356
356
  await _agent.waitForIdle();
357
357
 
358
- // Fire-and-forget with .catch() as final safety net.
359
- // The continue() monkey-patch means the session can't collide
360
- // with us even if it tries — but .catch() is belt-and-suspenders.
361
- _agent.prompt([]).catch(() => {});
358
+ try {
359
+ // Await so _continueInProgress stays true for the full retry.
360
+ // The session's continue() is blocked (monkey-patch) and the
361
+ // session's _runAgentPrompt stays alive, keeping the UI
362
+ // "Working…" until the agent is actually done.
363
+ await _agent.prompt([]);
364
+ } catch {
365
+ // Ignore — if prompt throws, something else is driving.
366
+ // The session will handle it or report the error.
367
+ }
362
368
  } finally {
363
369
  _continueInProgress = false;
364
370
  }