pi-quiver 6.13.0 → 6.13.2

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.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@ Published to npm as `pi-quiver` (`pi install npm:pi-quiver`). Pushing a
8
8
  via OIDC trusted publishing. The release helper at
9
9
  `.agents/skills/release/scripts/release.sh` cuts the tag; CI publishes.
10
10
 
11
+ ## v6.13.2 - 2026-10-08
12
+
13
+ - `provider-stall-watchdog`: a `before_provider_request` that arrives while a tool is executing no longer arms the first-event deadline. Pi >= 0.86 prompt-cache warming (`cacheWarming: "streaming"`, the default) re-sends the captured request about 270s into a long tool call with the extension hooks attached; that request emits no `message_start`, so the watchdog aborted the run `firstEventMs` later and SIGTERMed every running subagent (exit 143). Real provider requests never start mid-tool.
14
+
15
+ ## v6.13.1 - 2026-10-08
16
+
17
+ - `pi-quiver` CLI: SIGTERM/SIGINT/SIGHUP now kill the detached doc-to-md converter group (python, raster worker, soffice) before exiting with 128+signo; before, a signal-killed CLI orphaned the converter because the `exit` hook does not run on signal death. Library behavior inside pi is unchanged.
18
+
11
19
  ## v6.13.0 - 2026-10-06
12
20
 
13
21
  - `doc_to_md` / `pi-quiver doc-to-md`: `quiver.docToMd.ocrMaxPages` (default 10, settings-only) caps the pages one call OCRs. `ocrMode: "all"` rejects a larger distinct-page selection before any work (CLI exit 2), counting merged ranges without expanding them; textless mode OCRs the first `ocrMaxPages` textless pages and lists the rest as `ceilingStopped` with the `pages` to rerun. Integer settings now require safe integers. (#29)
@@ -1290,6 +1290,11 @@ function killTree(child) {
1290
1290
  process.on("exit", () => {
1291
1291
  for (const c of LIVE) killTree(c);
1292
1292
  });
1293
+ var SIGNAL_EXIT_CODES = { SIGHUP: 1, SIGINT: 2, SIGTERM: 15 };
1294
+ function exitOnSignalKillingChildren() {
1295
+ if (process.platform === "win32") return;
1296
+ for (const [sig, num] of Object.entries(SIGNAL_EXIT_CODES)) process.on(sig, () => process.exit(128 + num));
1297
+ }
1293
1298
  async function runCapped(cmd, args, opts) {
1294
1299
  return new Promise((resolveP) => {
1295
1300
  let settled = false;
@@ -2252,9 +2257,12 @@ function isMainEntry() {
2252
2257
  return false;
2253
2258
  }
2254
2259
  }
2255
- if (isMainEntry()) main().then((code) => {
2256
- process.exitCode = code;
2257
- });
2260
+ if (isMainEntry()) {
2261
+ exitOnSignalKillingChildren();
2262
+ main().then((code) => {
2263
+ process.exitCode = code;
2264
+ });
2265
+ }
2258
2266
  export {
2259
2267
  cliAgentDir,
2260
2268
  parseCliArgs,
@@ -377,7 +377,14 @@ export function createProviderStallWatchdog(runtime: WatchdogRuntime = defaultRu
377
377
  timers.recovery = runtime.setTimeout(run("recovery", thresholds.recoveryMs), thresholds.recoveryMs);
378
378
  };
379
379
 
380
+ // Pi's prompt-cache warmer re-sends the captured request (with its onPayload hook) while a long
381
+ // tool call is still running; that request never produces a message_start, so arming on it
382
+ // would abort the run and kill the tool's children. No real provider request starts mid-tool.
383
+ let toolsExecuting = 0;
384
+ pi.on("tool_execution_start", () => { toolsExecuting++; });
385
+ pi.on("tool_execution_end", () => { toolsExecuting = Math.max(0, toolsExecuting - 1); });
380
386
  pi.on("before_provider_request", (_event, ctx) => {
387
+ if (toolsExecuting > 0) return;
381
388
  if (redriveTimer !== undefined) resetRunState();
382
389
  if (redriveInFlight) {
383
390
  redriveInFlight = false;
@@ -493,7 +500,7 @@ export function createProviderStallWatchdog(runtime: WatchdogRuntime = defaultRu
493
500
  });
494
501
  tick();
495
502
  };
496
- pi.on("agent_end", () => disarm());
503
+ pi.on("agent_end", () => { toolsExecuting = 0; disarm(); });
497
504
  pi.on("agent_settled", async (_event, ctx) => {
498
505
  if (exhaustedAbortGeneration !== undefined && exhaustedAbortGeneration === watchdogAbortedGeneration) { announce(DEGRADATION_NOTICE); resetRunState(); return; }
499
506
  if (convertedTimeout && continuationStarted) { resetRunState(); return; }
@@ -81,6 +81,16 @@ function killTree(child: ChildProcess): void {
81
81
 
82
82
  process.on("exit", () => { for (const c of LIVE) killTree(c); });
83
83
 
84
+ // Children run detached (own process group) so killTree can take out python + raster
85
+ // worker + soffice at once; the flip side is that a signal that kills this process never
86
+ // reaches them, and the "exit" hook does not run on a signal death. The CLI opts in to
87
+ // turning TERM/INT/HUP into a normal exit so the hook fires; pi's own host keeps its handlers.
88
+ const SIGNAL_EXIT_CODES = { SIGHUP: 1, SIGINT: 2, SIGTERM: 15 } as const;
89
+ export function exitOnSignalKillingChildren(): void {
90
+ if (process.platform === "win32") return;
91
+ for (const [sig, num] of Object.entries(SIGNAL_EXIT_CODES)) process.on(sig as NodeJS.Signals, () => process.exit(128 + num));
92
+ }
93
+
84
94
  export async function runCapped(
85
95
  cmd: string,
86
96
  args: string[],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-quiver",
3
- "version": "6.13.0",
3
+ "version": "6.13.2",
4
4
  "description": "Personal pack of Pi coding-agent extensions: context-safe fetch, doc_to_md PDF/DOCX/PPTX-to-Markdown conversion, session naming, a themed ASCII startup header, Opus 4.8 fast mode, and a provider-stall watchdog.",
5
5
  "author": "Jacek Juraszek",
6
6
  "license": "MIT",