@arhen/pi-core-subagent 1.3.60 → 1.3.61

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/README.md CHANGED
@@ -51,7 +51,7 @@ flowchart LR
51
51
  - **Proof is an exit code, never a self-report.** Tasks are asked for a runnable `Verify:` command; the leader checks `git diff --stat`. Agents auditing their own work score ~0. ([why](#why-9-is-a-verification-command-not-a-self-report))
52
52
  - **No ceremony without edges.** Six independent reviewers stay six independent reviewers — no waves, no gates, no graph vocabulary imposed on flat work.
53
53
  - **Agent files respected.** A spawn goal (name + task) that matches a user agent file's `description` (`.agents/agents`, `.claude/agents`, `.pi/agents` — project then home) loads that file — body = system prompt, frontmatter `model`/`tools` apply, file `model` validated against the pi model registry. File wins over inline; no match → on-demand definition.
54
- - **Two toolsets, plus explicit override.** Read-only (`read, grep, find, ls` — default) or write (`read, grep, find, ls, bash, edit, write` — `write: true`); `tools:` sets an explicit per-task allowlist.
54
+ - **Two toolsets, plus explicit override.** Read-only (`read, grep, find, ls, codemode` — default) or write (`read, grep, find, ls, bash, edit, write, codemode` — `write: true`); `tools:` sets an explicit per-task allowlist. Children run with `noExtensions`, so `codemode` is the one extension they get: it lets a child batch `tools.*` calls instead of spending a model turn per call.
55
55
  - **In-process** — children are `AgentSession`s in the same runtime. No process spawn, no context bleed.
56
56
  - **Zero parent-context injection.** No catalog, no context hook. 7 slim tools total.
57
57
  - **Throttled updates** — widget/stream updates coalesce to ~6/s; no per-event deep clones.
@@ -294,7 +294,7 @@ Background (default) + intercom — the run returns a runId immediately; you sta
294
294
  | `await_subagent` | block until a run finishes (optional `timeoutMs`) |
295
295
  | `reply_subagent` | answer a child's `ask_parent` question |
296
296
  | `steer_subagent` | inject a steering message into a running child's session (queues as steer if mid-turn; lands at its next model boundary) |
297
- | `resume_subagent` | revive a failed/aborted task in its original session (context + branch preserved); optional `model` swap and custom `message` |
297
+ | `resume_subagent` | revive a failed/aborted task in its original session (context + branch preserved); optional `model` swap, `thinking` override (the task's stored level is clamped to what the target model accepts), custom `message`. Waits for the reopened session to go idle before prompting, so a task killed mid-turn can still be resumed |
298
298
  | `subagent_cancel` | abort a running/queued run |
299
299
 
300
300
  ### Per-task fields
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arhen/pi-core-subagent",
3
- "version": "1.3.60",
3
+ "version": "1.3.61",
4
4
  "type": "module",
5
5
  "description": "pi extension: fast in-process subagents with a dependency-graph scheduler (needs edges gate tasks and carry upstream output into dependent prompts), plus background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
6
6
  "license": "MIT",
package/src/manager.ts CHANGED
@@ -1010,6 +1010,9 @@ export class SubagentManager {
1010
1010
  });
1011
1011
 
1012
1012
  const maxRuntimeMs = input.maxRuntimeMs ?? (this.autoLimit ? DEFAULT_RUNTIME_MS : UNLIMITED_RUNTIME_MS);
1013
+ // A resumed session can still be draining the turn that failed or timed out. Prompting while
1014
+ // its agent is mid-run is rejected outright ("already processing a prompt"), so wait first.
1015
+ if (resume) await child.waitForIdle();
1013
1016
  const promptPromise = child.prompt(resume?.message ?? task.task, { source: "extension" });
1014
1017
  const races: Promise<unknown>[] = [promptPromise, childFailurePromise, childEndPromise];
1015
1018
  if (maxRuntimeMs > 0) {