pi-crew 0.11.40 → 0.11.41
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 +45 -0
- package/dist/index.mjs +495 -495
- package/package.json +1 -1
- package/src/runtime/foreground-watchdog.ts +213 -26
- package/src/runtime/task-runner/live-executor.ts +146 -45
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.11.41] — fix wave 13: watchdog liveness — false "appears hung" alerts on healthy direct runs (2026-10-25)
|
|
6
|
+
|
|
7
|
+
Five false alarms landed in one working session (2026-10-24/25), all the same shape: healthy direct single-agent
|
|
8
|
+
runs executing ONE long tool call (a ~20-min CI poll loop; a ~20-min full test suite). Every run completed
|
|
9
|
+
normally — the watchdog's *evidence* was frozen, not the run (SPEC `fixwave13-watchdog-liveness-2026-10-25`).
|
|
10
|
+
Unlike the T1/T4 incidents already covered by WD-DELIVER-GUARD / WD-STALE-RECORD, these verdicts were wrong at
|
|
11
|
+
emit time: the run genuinely was still running.
|
|
12
|
+
|
|
13
|
+
**Fixed — root cause: evidence frozen during long tool calls (GAP-0).** The hung verdict in
|
|
14
|
+
`src/runtime/foreground-watchdog.ts` reached through `isLikelyOrphanedActiveRun` used only the manifest
|
|
15
|
+
`updatedAt` and agent `progress.lastActivityAt` — and both freeze by construction while a tool runs:
|
|
16
|
+
`persistLiveProgress` was purely event-driven (no pi events fire during a 20-min bash call) and `updateRunStatus`
|
|
17
|
+
writes `updatedAt` only on status transitions. The 5-min activity shield expires, the next cycle reads a stale
|
|
18
|
+
manifest ⇒ false hung.
|
|
19
|
+
|
|
20
|
+
**Added — watchdog liveness short-circuit (F1).** Before a hung verdict is emitted, the watchdog now consults the
|
|
21
|
+
two liveness signals other consumers already trust: a fresh **active-run registry claim** (registered at dispatch)
|
|
22
|
+
⇒ the alert is suppressed for up to `CLAIMED_RUN_HUNG_MS` = 45 min, OR a fresh **task heartbeat**
|
|
23
|
+
(`heartbeat.lastSeenAt` on a running/waiting task, `alive !== false`) ⇒ no alert. The hung ladder for unclaimed
|
|
24
|
+
runs is unchanged (`ORPHANED_ACTIVE_RUN_MS` untouched — dashboard semantics preserved).
|
|
25
|
+
|
|
26
|
+
**Added — live-executor heartbeat timer (GAP-1).** `src/runtime/task-runner/live-executor.ts` now runs an unref'd
|
|
27
|
+
`LIVE_TOOL_HEARTBEAT_INTERVAL_MS` = 30 s interval, active only while a tool executes, throttled persist of live
|
|
28
|
+
progress, cleared in `finally`; no event-log writes. The state store no longer freezes mid-tool for ANY consumer
|
|
29
|
+
(watchdog, dashboard, doctor).
|
|
30
|
+
|
|
31
|
+
**Added — evidence timestamp (GAP-2).** The watchdog alert detail now carries `as of <updatedAt>` so a fresh alert
|
|
32
|
+
is distinguishable from a stale or queued one.
|
|
33
|
+
|
|
34
|
+
**Fixed — `steer-live` test fixture orphan leak (GAP-3).** 13 orphan background-runner processes from the
|
|
35
|
+
`steer-live` test were found alive and killed manually — 5 born AFTER wave 12 shipped (a different fixture from
|
|
36
|
+
the `steer-clamp` test wave 12 fixed). `test/unit/extension/core/subagent-steer-live.test.ts` spawns a REAL
|
|
37
|
+
background runner through the SUT (setsid + detached + SIGTERM-swallowing) and held no handle on it. Teardown now
|
|
38
|
+
resolves the runner pid from `manifest.async.pid` → `async.pid` → state scan, reaps via `reapGroup` when
|
|
39
|
+
`pgid === pid` (with `/proc/<pid>/cwd` scoping + self-pid guard), falls back to a pid-SIGKILL, and runs in
|
|
40
|
+
`finally` + `after()`.
|
|
41
|
+
|
|
42
|
+
**Battery (PASS).** targeted ×3 (`foreground-watchdog` 29/29, `live-executor-heartbeat` 5/5, `subagent-steer-live`
|
|
43
|
+
4/4), `test:critical` 124/124, full unit 10,061 pass / 0 fail / 4 skipped, integration 144/0/4, static gates 0,
|
|
44
|
+
dist MATCH. **Live repro on the real dist** (`PI_CREW_WATCHDOG_INTERVAL_MS=20000` + a 400 s tool): 5 hung verdicts
|
|
45
|
+
suppressed by the new liveness short-circuit, 0 alerts delivered — while the same box's older 0.11.40 verifier
|
|
46
|
+
session emitted 2 false alerts during the battery (the exact pre-fix behavior).
|
|
47
|
+
|
|
48
|
+
**Docs.** battery report `docs/real-test/reports/real-test-2026-10-25-wave13-watchdog-liveness-battery.md`.
|
|
49
|
+
|
|
5
50
|
## [0.11.40] — fix wave 12: fixture teardown — test-harness orphan leaks (2026-10-24)
|
|
6
51
|
|
|
7
52
|
Closes the leak class wave 11 exposed but did not own: the reaping wave made production descendants provable, and
|