pi-crew 0.3.6 → 0.3.8

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 (44) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +1 -1
  3. package/src/agents/discover-agents.ts +2 -1
  4. package/src/config/config.ts +760 -229
  5. package/src/config/types.ts +34 -5
  6. package/src/extension/help.ts +1 -0
  7. package/src/extension/management.ts +2 -1
  8. package/src/extension/register.ts +1176 -255
  9. package/src/extension/registration/commands.ts +15 -2
  10. package/src/extension/registration/team-tool.ts +1 -1
  11. package/src/extension/session-summary.ts +11 -1
  12. package/src/extension/team-tool/api.ts +4 -1
  13. package/src/extension/team-tool/cache-control.ts +23 -0
  14. package/src/extension/team-tool/cancel.ts +27 -16
  15. package/src/extension/team-tool/context.ts +2 -0
  16. package/src/extension/team-tool/handle-settings.ts +2 -0
  17. package/src/extension/team-tool/health-monitor.ts +563 -0
  18. package/src/extension/team-tool/inspect.ts +10 -3
  19. package/src/extension/team-tool/lifecycle-actions.ts +12 -5
  20. package/src/extension/team-tool/respond.ts +6 -3
  21. package/src/extension/team-tool/status.ts +4 -1
  22. package/src/extension/team-tool-types.ts +2 -0
  23. package/src/extension/team-tool.ts +901 -177
  24. package/src/runtime/adaptive-plan.ts +1 -1
  25. package/src/runtime/child-pi.ts +15 -2
  26. package/src/runtime/crash-recovery.ts +30 -0
  27. package/src/runtime/foreground-watchdog.ts +129 -0
  28. package/src/runtime/manifest-cache.ts +4 -2
  29. package/src/runtime/pi-args.ts +3 -2
  30. package/src/runtime/run-tracker.ts +11 -0
  31. package/src/runtime/runtime-policy.ts +15 -2
  32. package/src/runtime/skill-instructions.ts +11 -0
  33. package/src/runtime/stale-reconciler.ts +322 -18
  34. package/src/runtime/task-runner.ts +8 -1
  35. package/src/schema/config-schema.ts +1 -0
  36. package/src/schema/team-tool-schema.ts +204 -76
  37. package/src/state/atomic-write.ts +2 -2
  38. package/src/state/locks.ts +19 -0
  39. package/src/state/mailbox.ts +22 -5
  40. package/src/state/state-store.ts +13 -3
  41. package/src/teams/discover-teams.ts +2 -1
  42. package/src/ui/run-event-bus.ts +2 -1
  43. package/src/ui/settings-overlay.ts +2 -0
  44. package/src/workflows/discover-workflows.ts +5 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.8] — Zombie Run Auto-Repair & Test Stability (2026-05-25)
4
+
5
+ ### Features
6
+ - **Periodic auto-repair timer** — `autoRepairIntervalMs` in `CrewReliabilityConfig` (default 60s, 0 to disable) calls `reconcileAllStaleRuns` via `configureObservability`. Timer uses `.unref()` to avoid blocking Node exit; cleaned up on session shutdown.
7
+ - **`wait` action** — New `team action='wait'` polls a running team until completion. Accepts `runId` (required), `config.timeoutMs` (default 300 000 ms), and `config.pollIntervalMs` (default 2 000 ms). Returns run status, summary, and per-task statuses. Resolves via `waitForRun` in `run-tracker.ts`.
8
+
9
+ ### Bug Fixes
10
+ - **No-PID zombie run repair** — Runs without async PID (e.g. live-session /tmp workspaces) previously waited 24h for repair. Now `stale-reconciler` checks if ALL running tasks have heartbeats stale >5min (`NO_PID_HEARTBEAT_STALE_MS`) and repairs immediately.
11
+ - **Orphaned /tmp workspace cleanup** — `reconcileOrphanedTempWorkspaces()` scans `/tmp/pi-crew-*` for stale `running` manifests and auto-cancels them. Runs every 5min alongside per-CWD reconciliation.
12
+ - **Live-session test hang at depth > 0** — `runtime-policy.ts` now skips child-process override when `PI_CREW_MOCK_LIVE_SESSION='success'`, preventing tests from spawning real pi processes that hung indefinitely.
13
+
14
+ ### Tests
15
+ - New `test/unit/auto-repair-timer.test.ts` (5 test cases for zombie reconciliation).
16
+ - New `test/fixtures/test-tempdir.ts` — tracks temp dirs with `test.after()` cleanup.
17
+ - Updated `live-session-context.test.ts` and `live-session-runtime.test.ts` to use tracked temp dirs and `PI_CREW_DEPTH=0`.
18
+ - Updated `stale-reconciler.test.ts` for new reconciliation paths.
19
+
3
20
  ## [0.3.0] — Phase 3a+3b: Discovery Cache, Dynamic Agent Registry, Rich TUI Rendering (2026-05-23)
4
21
 
5
22
  ### Phase 3a: Agent Discovery Cache
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-crew",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
5
5
  "author": "baphuongna",
6
6
  "license": "MIT",
@@ -174,7 +174,8 @@ export function listDynamicAgents(): AgentConfig[] {
174
174
  return [...dynamicAgents.values()];
175
175
  }
176
176
 
177
- export function allAgents(discovery: AgentDiscoveryResult): AgentConfig[] {
177
+ export function allAgents(discovery: AgentDiscoveryResult | undefined): AgentConfig[] {
178
+ if (!discovery) return [];
178
179
  const byName = new Map<string, AgentConfig>();
179
180
  // Priority for disambiguation (security): project < builtin < user.
180
181
  // Project config cannot override trusted builtins (security-hardening).