pi-goal-list-loop-audit 0.34.4 → 0.34.6

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.
@@ -991,8 +991,21 @@ function heartbeatTick(): void {
991
991
  })
992
992
  ) {
993
993
  lastWedgeAlertAt = Date.now();
994
- const msg = `${goalNoun()} appears wedged: no activity for ${Math.round((Date.now() - lastActivityAt) / 60_000)}m while the session is busy — likely a hung command (test/build/dev server without a timeout). Check the session; Esc kills a stuck tool call.`;
995
- appendLedger(ctx.cwd, "wedge_alert", { silentMs: Date.now() - lastActivityAt });
994
+ // v0.34.5: a wedge while blocked on a subagent wait is a DIFFERENT animal
995
+ // from a hung bash command (junk-runner 2026-08-01: 2 Explore agents
996
+ // "thinking…" 31 minutes — working, but indistinguishable from hung
997
+ // without this hint). Name the wait and give the liveness check: a child
998
+ // whose tool-use counter stops moving is hung, not thinking.
999
+ const subWaits = new Set(
1000
+ [...inFlightToolCalls.values()]
1001
+ .filter((t) => t.name === "get_subagent_result" || t.name === "Agent")
1002
+ .map((t) => t.name),
1003
+ );
1004
+ const subHint = subWaits.size > 0
1005
+ ? ` The in-flight call is a SUBAGENT WAIT (${[...subWaits].join("/")}) — check the Agents panel: a child whose tool-use/token counters have stopped moving between checks is hung, not thinking (hard failures surface as ✗ failed + the wait returns; a HANG is silent). Esc interrupts the wait — then collect the survivors with get_subagent_result and absorb the dead scope inline.`
1006
+ : "";
1007
+ const msg = `${goalNoun()} appears wedged: no activity for ${Math.round((Date.now() - lastActivityAt) / 60_000)}m while the session is busy — likely a hung command (test/build/dev server without a timeout).${subHint} Check the session; Esc kills a stuck tool call.`;
1008
+ appendLedger(ctx.cwd, "wedge_alert", { silentMs: Date.now() - lastActivityAt, subagentWait: subWaits.size > 0 });
996
1009
  ctx.ui.notify(msg, "warning");
997
1010
  notifyExternal(ctx, msg);
998
1011
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-list-loop-audit",
3
- "version": "0.34.4",
3
+ "version": "0.34.6",
4
4
  "description": "Mission control for autonomous pi: interview-drafted goals, an audited task queue, and forever-loops (metric, spec, project-audit) that run for hours. An isolated extension-less auditor re-verifies every completion with raw evidence; confirmed drafts, decision pauses and consent gates keep you in charge.",
5
5
  "license": "MIT",
6
6
  "author": "dracon",
@@ -88,14 +88,16 @@ When the user says "do a full audit", "survey the project", "find all problems",
88
88
  4. Don't ship a single bug fix and then ask if the user wants to continue — the user already said "do a full audit".
89
89
  5. After the task list is confirmed, work through tasks systematically with `complete_task` / `update_task_status`.
90
90
 
91
- ## WHEN SUBAGENTS DIE ON TOKEN LIMITS
91
+ ## WHEN SUBAGENTS DIE: RESUME, DON'T RESPAWN
92
92
 
93
- If a subagent fails with `run hit the output token limit` (or returns an error after many tool uses with no report): do NOT respawn the same wide briefit will die the same way. Either:
93
+ A failed subagent's SESSION survives its death (verified in pi-subagents source: `resume` has no status guard it re-prompts the existing session, context intact). The 56 tool uses of work are NOT lost unless you throw them away. On any subagent failure output token limit, quota, provider error:
94
94
 
95
- 1. **Split it**: the brief was too widerespawn as 2 narrower agents (half the subsystems each), or
96
- 2. **Absorb it**: if the unscanned area is small, survey it inline yourself.
95
+ 1. **Resume it**: `Agent(resume: "<id>", prompt: "Wrap up now: report what you found within ~150 lines.")` for quota deaths, wait for the quota window first (see below). A resumed agent already HAS its research; it only needs to report.
96
+ 2. **Resume failed with "not found"?** The manager forgot it (a /reload wipes the in-process registry old IDs are unresumable). Only NOW respawn, and never the same wide brief: SPLIT into 2 narrower agents or ABSORB the remainder inline.
97
97
 
98
- A dead subagent's partial work is LOST prevention (tight briefs, report caps) is cheaper than recovery.
98
+ ## AFTER A SESSION RESTART: YOUR SUBAGENTS ARE DEAD
99
+
100
+ Subagents run IN-PROCESS — a /reload or restart kills every running one instantly and silently (no failure event, no ✗), and their IDs become unresumable. On a restored session, check your transcript for in-flight agents and relaunch them (tight briefs) or absorb their scope — do NOT sit waiting for results that can never arrive. This is why long fan-out passes belong under a glla goal/list item: the goal plane survives restarts and re-drives the fan-out through the continuation; an ad-hoc fan-out dies with the tab.
99
101
 
100
102
  ## WHEN SUBAGENTS HIT QUOTA ERRORS
101
103