pi-messenger 0.11.0 → 0.12.1
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 +70 -0
- package/README.md +90 -22
- package/config.ts +6 -0
- package/crew/agents/crew-plan-sync.md +1 -1
- package/crew/agents/crew-planner.md +18 -2
- package/crew/agents/crew-reviewer.md +1 -1
- package/crew/agents/crew-worker.md +14 -1
- package/crew/agents.ts +105 -49
- package/crew/handlers/coordination.ts +275 -0
- package/crew/handlers/plan.ts +324 -37
- package/crew/handlers/review.ts +7 -4
- package/crew/handlers/revise.ts +374 -0
- package/crew/handlers/status.ts +91 -57
- package/crew/handlers/sync.ts +6 -6
- package/crew/handlers/task.ts +214 -92
- package/crew/handlers/work.ts +97 -92
- package/crew/index.ts +22 -46
- package/crew/live-progress.ts +1 -0
- package/crew/lobby.ts +470 -0
- package/crew/prompt.ts +112 -0
- package/crew/registry.ts +114 -0
- package/crew/spawn.ts +103 -0
- package/crew/state-autonomous.ts +134 -0
- package/crew/state-planning.ts +263 -0
- package/crew/state.ts +14 -66
- package/crew/store.ts +154 -21
- package/crew/task-actions.ts +123 -0
- package/crew/types.ts +11 -2
- package/crew/utils/config.ts +40 -3
- package/crew/utils/discover.ts +26 -65
- package/crew/utils/install.ts +39 -333
- package/crew/utils/progress.ts +14 -4
- package/feed.ts +88 -23
- package/handlers.ts +66 -34
- package/index.ts +330 -160
- package/install.mjs +14 -63
- package/overlay-actions.ts +511 -0
- package/overlay-render.ts +650 -0
- package/overlay.ts +584 -552
- package/package.json +3 -2
- package/skills/pi-messenger-crew/SKILL.md +194 -24
- package/store.ts +17 -8
- package/crew/agents/crew-interview-generator.md +0 -79
- package/crew/handlers/interview.ts +0 -211
- package/crew-overlay.ts +0 -270
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.12.1] - 2026-02-22
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **Wrong model resolved for `provider/model` format** - Worker spawn passed `--model zai/glm-5` as a single flag, which pi's model resolver matched as a literal model ID under `vercel-ai-gateway` instead of interpreting `zai` as the provider. Now splits `provider/model` into separate `--provider` and `--model` flags, matching the intended provider. Affects both task workers and lobby workers.
|
|
7
|
+
|
|
8
|
+
## [0.12.0] - 2026-02-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Thinking level support** - Agents support `thinking: <level>` in frontmatter (off, minimal, low, medium, high, xhigh). Config `thinking.<role>` overrides per-agent frontmatter. Applied via `--thinking` flag to spawned processes.
|
|
12
|
+
- **Advisory dependencies** - Dependencies are now informational context, not scheduling blockers. All `todo` tasks are eligible for assignment regardless of dependency status. Workers see dependency completion state (done/in-progress/not started) in their prompt and coordinate via reservations and DMs. Configurable via `dependencies` config (`"advisory"` default, `"strict"` for blocking mode). Transitive dependencies pruned from plans automatically.
|
|
13
|
+
- **Auto-work on plan completion** - Planning automatically starts autonomous work when tasks are created (default behavior). Pass `autoWork: false` to review the plan first. A steer message triggers the LLM to call `work { autonomous: true }` on its next turn.
|
|
14
|
+
- **Continuous worker refill** - Overlay automatically spawns replacement workers when tasks complete, maintaining concurrency up to the configured limit throughout execution.
|
|
15
|
+
- **Prompt-based planning** - `plan` action accepts an inline `prompt` parameter as the spec when no PRD file is available. The planner breaks down arbitrary requests into parallel tasks the same way it handles PRD files.
|
|
16
|
+
- **Live feed with flash notifications** - Feed tracks last-seen timestamp and highlights new events. Significant events (task completions, messages, plan changes) trigger flash notifications in the status bar.
|
|
17
|
+
- **Task revision** - `[p]` revises a single task's spec via the planner. `[P]` revises an entire subtree (target + transitive dependents), preserving done tasks and resetting revisable ones to `todo`. Re-plan with steering prompt injects user guidance into the planning-progress.md Notes section.
|
|
18
|
+
- **Chat UX redesign** - Global `[m]` key activates chat input from any overlay state (vim-style command mode). Plain text broadcasts to all peers; `@name message` sends DMs. Tab autocompletes agent names after `@` (Shift+Tab cycles backwards). Feed gets 60/40 space allocation when workers active. `[f]` toggles feed-focus mode (tasks compress to 2-line summary). Visual improvements: system events dimmed, colored agent names, separator dots between groups.
|
|
19
|
+
- **Auto-dismiss on completion** - Overlay auto-closes with snapshot handover 3 seconds after all tasks complete. Only triggers when the overlay witnessed tasks in progress. Any keypress cancels.
|
|
20
|
+
- **Worker coordination & chatter** - Workers receive environmental context (concurrent tasks, dependency summaries, recent feed, ready tasks) and coordination instructions. Four configurable levels (`none`|`minimal`|`moderate`|`chatty`, default: `chatty`) control verbosity. At `chatty`, workers DM peers and broadcast announcements, creating a chat-room effect in the overlay. New `coordination` config field.
|
|
21
|
+
- **Lobby workers** - `+` spawns workers: assigns ready tasks directly when available, otherwise pre-spawns idle lobby workers that join the mesh and chat. Lobby workers receive task assignments via steer message when tasks become available. Token budgets per coordination level cap spending while idle.
|
|
22
|
+
- **Auto-spawn on plan completion** - Workers auto-spawn when planning finishes and ready tasks exist. Lobby workers assigned first, then fresh workers up to concurrency limit.
|
|
23
|
+
- **TUI coordination level control** - `[v]` cycles coordination level at runtime (`chatty` → `none` → `minimal` → `moderate`).
|
|
24
|
+
- **Configurable `concurrency.max`** - Crew config field (default: 10) lets the user lower the worker ceiling. `+`/`-` keys respect the configured max.
|
|
25
|
+
- **Stuck task UX** - `[q]` Stop works on any `in_progress` task, not just those with live workers. `[s]` Start rejects when the agent is already busy. Detail view shows "Worker not running" warning for orphaned tasks.
|
|
26
|
+
- **Chatter mitigation** - Per-worker outgoing message rate limiting via `messageBudgets` config. Coordination level and per-worker token count displayed in overlay header.
|
|
27
|
+
- **Broadcast filtering** - Worker broadcasts now go to the feed only (no inbox delivery, no LLM turn interrupts). Eliminates O(N^2) token cascades between workers. DMs, user broadcasts, and planner broadcasts still deliver to inboxes in real-time. Detection via `PI_CREW_WORKER` env var set at spawn time. Worker name consistency also fixed in `agents.ts` via `PI_AGENT_NAME`.
|
|
28
|
+
- **Worker exit feed notifications** - Lobby workers that exit without a task assignment now appear as `leave` events in the feed.
|
|
29
|
+
- **2026-02-12 Overlay redesign** - Replaced tabbed `/messenger` UI with a unified crew dashboard layout (status, workers, tasks, feed, agents row, legend), added `Ctrl+T` snapshot transfer, `Ctrl+B` background/reattach support, empty-state system diagnostics, and inline `@all` / `@name` messaging in the overlay input flow.
|
|
30
|
+
- **Task progress system** - Added per-task append-only progress logs (`tasks/task-N.progress.md`) with `task.progress`, system auto-entries (assignment, review verdicts, shutdown resets, crash/failure outcomes), and retry-context injection in worker prompts.
|
|
31
|
+
- **Interactive Crew task manager** - Crew overlay now supports list/detail modes, task actions (reset/cascade-reset/unblock/start/block/delete), in-overlay confirmations, block-reason input, live worker messaging, context-aware key hints, and transient success/failure notifications.
|
|
32
|
+
- **Live worker concurrency adjustment** - In the Crew overlay, `+`/`-` now adjusts worker concurrency live during execution (clamped to 1-10).
|
|
33
|
+
- **Auto-open overlay on autonomous work** - The Crew overlay now opens automatically when autonomous mode starts, showing live worker progress without requiring `/messenger`. Configurable via `autoOverlay` (default: `true`). Escape dismisses; won't reopen until a new autonomous session.
|
|
34
|
+
- **Auto-open overlay on planning work** - The Crew overlay now opens automatically when planning starts and when an in-progress planning run is restored on session start/switch/fork/tree. Configurable via `autoOverlayPlanning` (default: `true`). Uses per-run planning IDs to avoid reopen loops within the same run after dismissal.
|
|
35
|
+
- **Task splitting** - New `task.split` action supports an inspect phase (returns spec/progress/deps/dependents) and an execute phase that creates subtasks, rewires downstream dependencies, converts the parent to a milestone, and auto-completes milestones when all subtasks are done. Milestones can't be started manually and are never dispatched to workers.
|
|
36
|
+
- **Planning observability state** - Added first-class planning run state with pass/phase tracking and persistence at `.pi/messenger/crew/planning-state.json`. Status, Crew UI, and feed now expose planning progress (`plan.start`, `plan.pass.*`, `plan.review.*`, `plan.done`, `plan.failed`) so long planning runs are visible by default. Planning runs with no updates for 5 minutes are flagged as stalled in status and Crew UI, with periodic refresh so stalls surface without requiring user interaction.
|
|
37
|
+
- **Planning cwd normalization** - Planning state now canonicalizes project paths (realpath) and compares by canonical path, fixing false negatives when sessions use `/tmp/...` while persisted state resolves to `/private/tmp/...`.
|
|
38
|
+
- **Structured planning outline** - Planner prompts now require ordered sections (PRD understanding, reviewed resources, sequential steps, parallel task graph). Latest structured output is persisted to `.pi/messenger/crew/planning-outline.md` for audit/review.
|
|
39
|
+
|
|
40
|
+
- **Lobby worker keep-alive** - Lobby workers now survive the full planning phase via a file-based keep-alive signal. The orchestrator creates a `.alive` file per lobby worker; the worker's `turn_end` hook checks the file and injects a minimal steer message to prevent the session from exiting. File is deleted on task assignment, planning completion, or shutdown. ~25 tokens per keep-alive cycle.
|
|
41
|
+
- **`prompt` tool parameter** - The `prompt` parameter (used by `plan` and `task.revise`/`task.revise-tree`) is now declared in the tool schema so LLMs can discover it without the skill loaded.
|
|
42
|
+
- **Dynamic overlay width** - Overlay adapts to terminal width (clamped 40-100) instead of a fixed size. Fits half-width and quarter-width windows on smaller screens.
|
|
43
|
+
- **Live coordination level display** - Status bar hints now show the actual coordination level (`v:chatty`, `v:none`, etc.) instead of the opaque `v:Coord` label.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- **Default `planning.maxPasses` reduced to 1** - Single-pass planning is now the default. Multi-pass planning with reviewer feedback is still available by setting `planning.maxPasses` in user or project config.
|
|
47
|
+
- **Structural cleanup** - Extracted `crew/prompt.ts` (worker prompt builder), `crew/spawn.ts` (shared spawn logic), `crew/registry.ts` (unified worker registry replacing separate maps in agents.ts and lobby.ts). Split `crew/state.ts` into `state-autonomous.ts` and `state-planning.ts` with a barrel re-export.
|
|
48
|
+
- **Crew agent locality** - Crew agents are now discovered from extension-local `crew/agents/` plus project overrides in `.pi/messenger/crew/agents/`. Removed auto-install/update copy machinery and converted `crew.install` / `--crew-install` to informational commands.
|
|
49
|
+
|
|
50
|
+
### Removed
|
|
51
|
+
- **Legacy key-based routing** - Removed the `join`, `claim`, `unclaim`, `complete`, `swarm`, `list`, `rename`, `reserve`, `release`, and `broadcast` tool parameters and the legacy routing block in `index.ts` that duplicated `crew/index.ts` action-based routing. All callers should use `action`-based syntax (e.g., `{ action: "join" }` instead of `{ join: true }`).
|
|
52
|
+
- **Interview handler** - Removed `crew/handlers/interview.ts`, `crew-interview-generator.md` agent, and the `interview` action. The feature spawned an LLM to generate questions for the user but never worked (got stuck). Agent moved to deprecated list for cleanup on existing installs.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **Overlay rendering corruption from multi-line bash args** - `extractArgsPreview` returned raw bash `command` strings containing newlines (comments, `&&` chains, heredocs). These embedded newlines broke overlay rows, cascading layout corruption through the workers section, task list, and feed. Newlines are now collapsed to spaces at the extraction point.
|
|
56
|
+
- **Fire-and-forget dynamic import in `task-actions.ts`** - `killWorkerByTask` was imported via `import("./registry.js").then(...)` which swallowed errors silently. Replaced with a static import since no circular dependency exists.
|
|
57
|
+
- **Stale legacy syntax in user-facing strings** - Five handler/index strings still referenced removed `{ join: true }` / `{ list: true }` / `{ to: "..." }` syntax. Updated to action-based equivalents.
|
|
58
|
+
- **SIGKILL escalation never fired** - After `proc.kill("SIGTERM")`, Node.js immediately sets `proc.killed = true`. Both `killWorkerByTask` and `runAgent` graceful shutdown checked `!proc.killed` before escalating to SIGKILL, which was always false. Workers ignoring SIGTERM could hang indefinitely. Now checks only `exitCode === null`.
|
|
59
|
+
- **Lobby worker assignment zombie state** - State was mutated before the disk write, so a failed write left the worker permanently marked as assigned but invisible to future assignment. Reordered to write first, mutate on success.
|
|
60
|
+
- **Lobby assignment race in work handler** - If a lobby worker exited between availability check and assignment, the task got stuck as `in_progress` with no worker. Added return value check with rollback.
|
|
61
|
+
- **Autonomous state checks not cwd-scoped** - Auto-dismiss, snapshot generation, and revision guards used a global flag instead of per-project checks, blocking operations for unrelated projects.
|
|
62
|
+
- **Task flicker from lobby worker spawn** - Orchestrator and worker generated independent random names so `assigned_to` never matched. Task was also pre-set to `in_progress` but the worker expected `todo`. Fixed name propagation via env var, made `task.start` idempotent for the assigned agent, and added ownership guards in close handlers.
|
|
63
|
+
- **`[q]` Stop couldn't kill lobby-spawned workers** - Stop only checked one worker registry. Lobby workers are tracked separately and now have their own kill path.
|
|
64
|
+
- **Double-formatted message previews** - Overlay stored pre-formatted previews that the display layer formatted again. Now stores raw text; preview limit raised from 60 to 200 chars.
|
|
65
|
+
- **Stale workersHeight in trim loop** - Worker-line overflow trimming used a pre-computed height, causing over-trim to 0 workers on small terminals.
|
|
66
|
+
- **Artifact I/O crash** - Uncaught exceptions in child process event handlers crashed pi. Wrapped all artifact writes with try/catch.
|
|
67
|
+
- **Input field scrolling** - Text was clipped at the field edge instead of scrolling to keep the cursor visible.
|
|
68
|
+
- **Session shutdown orphans** - Workers now killed at the top of session shutdown, preventing orphan processes.
|
|
69
|
+
- **Task list blank line padding** - Task list no longer pads with empty lines. Surplus space goes to the feed.
|
|
70
|
+
- **`getLobbyWorkerCount` counted dead workers** - Registry function didn't filter exited processes, inflating the "N in lobby" status bar count.
|
|
71
|
+
- **`models.analyst` config was dead** - Config type and docs existed but `interview.ts` and `sync.ts` never read it. Now wired to both analyst handler call sites.
|
|
72
|
+
|
|
3
73
|
## [0.11.0] - 2026-02-08
|
|
4
74
|
|
|
5
75
|
### Added
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Pi Messenger
|
|
6
6
|
|
|
7
|
-
**What if multiple agents in different terminals sharing a folder could talk to each other like they're in a chat room?** Join, see who's online and what they're doing. Claim tasks, reserve files, send messages.
|
|
7
|
+
**What if multiple agents in different terminals sharing a folder could talk to each other like they're in a chat room?** Join, see who's online and what they're doing. Claim tasks, reserve files, send messages. An extension for [Pi coding agent](https://pi.dev/) — install it and go. No daemon, no server, just files.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/pi-messenger)
|
|
10
10
|
[](LICENSE)
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
pi install npm:pi-messenger
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Crew agents
|
|
19
|
+
Crew agents ship with the extension (`crew/agents/*.md`) and are discovered automatically. The `pi-messenger-crew` skill is auto-loaded from the extension.
|
|
20
|
+
|
|
21
|
+
To show available crew agents:
|
|
20
22
|
|
|
21
23
|
```bash
|
|
22
24
|
npx pi-messenger --crew-install
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
To customize an agent for one project, copy it to `.pi/messenger/crew/agents/` and edit it.
|
|
26
28
|
|
|
27
29
|
To remove the extension:
|
|
28
30
|
|
|
@@ -30,7 +32,7 @@ To remove the extension:
|
|
|
30
32
|
npx pi-messenger --remove
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
To
|
|
35
|
+
To remove stale crew agent copies from the shared legacy directory (`~/.pi/agent/agents/`):
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
38
|
npx pi-messenger --crew-uninstall
|
|
@@ -75,7 +77,7 @@ pi_messenger({ action: "review", target: "task-1" }) // Reviewer checks imple
|
|
|
75
77
|
|
|
76
78
|
`/messenger` opens an interactive overlay with agent presence, activity feed, and chat:
|
|
77
79
|
|
|
78
|
-
<img width="
|
|
80
|
+
<img width="1198" height="1020" alt="pi-messenger crew overlay" src="https://github.com/user-attachments/assets/d66e5d71-5ed9-4702-9f56-9ca3f0e9c584" />
|
|
79
81
|
|
|
80
82
|
Chat input supports `@Name msg` for DMs and `@all msg` for broadcasts. Text without `@` broadcasts from the Agents tab or DMs the selected agent tab.
|
|
81
83
|
|
|
@@ -96,7 +98,14 @@ Crew turns a PRD into a dependency graph of tasks, then executes them in paralle
|
|
|
96
98
|
2. **Work** — Workers implement ready tasks (all dependencies met) in parallel waves. A single `work` call runs one wave. `autonomous: true` runs waves back-to-back until everything is done or blocked.
|
|
97
99
|
3. **Review** — Reviewer checks each implementation: SHIP, NEEDS_WORK, or MAJOR_RETHINK.
|
|
98
100
|
|
|
99
|
-
No special PRD format required — the planner auto-discovers `PRD.md`, `SPEC.md`, `DESIGN.md`, etc. in your project root and `docs/`.
|
|
101
|
+
No special PRD format required — the planner auto-discovers `PRD.md`, `SPEC.md`, `DESIGN.md`, etc. in your project root and `docs/`. Or skip the file entirely:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
pi_messenger({ action: "plan", prompt: "Scan the codebase for bugs" })
|
|
105
|
+
|
|
106
|
+
// Plan + auto-start autonomous work when planning completes
|
|
107
|
+
pi_messenger({ action: "plan" }) // auto-starts workers (default)
|
|
108
|
+
```
|
|
100
109
|
|
|
101
110
|
### Wave Execution
|
|
102
111
|
|
|
@@ -116,20 +125,54 @@ The planner structures tasks to maximize parallelism. Foundation work has no dep
|
|
|
116
125
|
|
|
117
126
|
### Crew Configuration
|
|
118
127
|
|
|
119
|
-
Add to `~/.pi/agent/pi-messenger.json`:
|
|
128
|
+
Crew spawns multiple LLM sessions in parallel — it can burn tokens fast. Start with a cheap worker model and scale up once you've seen the workflow. Add this to `~/.pi/agent/pi-messenger.json`:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{ "crew": { "models": { "worker": "claude-haiku-4-5" } } }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The planner and reviewer keep their frontmatter defaults; only workers (the bulk of the spend) get the cheap model. Override per-role as needed:
|
|
120
135
|
|
|
121
136
|
```json
|
|
122
137
|
{
|
|
123
138
|
"crew": {
|
|
124
|
-
"
|
|
125
|
-
|
|
139
|
+
"models": {
|
|
140
|
+
"worker": "claude-haiku-4-5",
|
|
141
|
+
"planner": "claude-sonnet-4-6",
|
|
142
|
+
"reviewer": "claude-sonnet-4-6"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Model strings accept `provider/model` format for explicit provider selection and `:level` suffix for inline thinking control. These work anywhere a model is specified — config, frontmatter, or per-task override:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"crew": {
|
|
153
|
+
"models": {
|
|
154
|
+
"worker": "anthropic/claude-haiku-4-5",
|
|
155
|
+
"planner": "openrouter/anthropic/claude-sonnet-4:high"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The `:level` suffix and the `thinking.<role>` config are independent — if both are set, the suffix takes precedence and the `--thinking` flag is skipped to avoid double-application.
|
|
162
|
+
|
|
163
|
+
Full config reference (all fields optional — only set what you want to change):
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"crew": {
|
|
168
|
+
"concurrency": { "workers": 2, "max": 10 },
|
|
169
|
+
"coordination": "chatty",
|
|
170
|
+
"models": { "worker": "claude-haiku-4-5" },
|
|
126
171
|
"review": { "enabled": true, "maxIterations": 3 },
|
|
127
|
-
"planning": { "maxPasses":
|
|
172
|
+
"planning": { "maxPasses": 1 },
|
|
128
173
|
"work": {
|
|
129
174
|
"maxAttemptsPerTask": 5,
|
|
130
|
-
"maxWaves": 50
|
|
131
|
-
"shutdownGracePeriodMs": 30000,
|
|
132
|
-
"env": { "NODE_ENV": "test" }
|
|
175
|
+
"maxWaves": 50
|
|
133
176
|
}
|
|
134
177
|
}
|
|
135
178
|
}
|
|
@@ -137,17 +180,39 @@ Add to `~/.pi/agent/pi-messenger.json`:
|
|
|
137
180
|
|
|
138
181
|
| Setting | Description | Default |
|
|
139
182
|
|---------|-------------|---------|
|
|
140
|
-
| `concurrency.workers` |
|
|
141
|
-
| `
|
|
183
|
+
| `concurrency.workers` | Default parallel workers per wave | `2` |
|
|
184
|
+
| `concurrency.max` | Maximum workers allowed (hard ceiling is 10) | `10` |
|
|
185
|
+
| `dependencies` | Dependency scheduling mode: `advisory` or `strict` | `"advisory"` |
|
|
186
|
+
| `coordination` | Worker coordination level: `none`, `minimal`, `moderate`, `chatty` | `"chatty"` |
|
|
187
|
+
| `messageBudgets` | Max outgoing messages per worker per level (sends rejected after limit) | `{ none: 0, minimal: 2, moderate: 5, chatty: 10 }` |
|
|
188
|
+
| `models.planner` | Model for planner agent | `anthropic/claude-opus-4-6` |
|
|
189
|
+
| `models.worker` | Model for workers (overridden by per-task or per-wave `model` param) | `anthropic/claude-haiku-4-5` |
|
|
190
|
+
| `models.reviewer` | Model for reviewer agent | `anthropic/claude-opus-4-6` |
|
|
191
|
+
| `models.analyst` | Model for analyst (plan-sync) agent | `anthropic/claude-haiku-4-5` |
|
|
192
|
+
| `thinking.planner` | Thinking level for planner agent | (from frontmatter) |
|
|
193
|
+
| `thinking.worker` | Thinking level for worker agents | (from frontmatter) |
|
|
194
|
+
| `thinking.reviewer` | Thinking level for reviewer agents | (from frontmatter) |
|
|
195
|
+
| `thinking.analyst` | Thinking level for analyst agents | (from frontmatter) |
|
|
142
196
|
| `review.enabled` | Auto-review after task completion | `true` |
|
|
143
197
|
| `review.maxIterations` | Max review/fix cycles per task | `3` |
|
|
144
|
-
| `planning.maxPasses` | Max planner/reviewer refinement passes | `
|
|
198
|
+
| `planning.maxPasses` | Max planner/reviewer refinement passes | `1` |
|
|
145
199
|
| `work.maxAttemptsPerTask` | Auto-block after N failures | `5` |
|
|
146
200
|
| `work.maxWaves` | Max autonomous waves | `50` |
|
|
147
201
|
| `work.shutdownGracePeriodMs` | Grace period before SIGTERM on abort | `30000` |
|
|
148
202
|
| `work.env` | Environment variables passed to spawned workers | `{}` |
|
|
149
203
|
|
|
150
|
-
|
|
204
|
+
### Default Agent Models
|
|
205
|
+
|
|
206
|
+
Each crew agent ships with a default model in its frontmatter. Override any of these via `crew.models.<role>` in config:
|
|
207
|
+
|
|
208
|
+
| Agent | Role | Default Model |
|
|
209
|
+
|-------|------|---------------|
|
|
210
|
+
| `crew-planner` | planner | `anthropic/claude-opus-4-6` |
|
|
211
|
+
| `crew-worker` | worker | `anthropic/claude-haiku-4-5` |
|
|
212
|
+
| `crew-reviewer` | reviewer | `anthropic/claude-opus-4-6` |
|
|
213
|
+
| `crew-plan-sync` | analyst | `anthropic/claude-haiku-4-5` |
|
|
214
|
+
|
|
215
|
+
Agent definitions live in `crew/agents/` within the extension. To customize one for a project, copy it to `.pi/messenger/crew/agents/` and edit the frontmatter — project-level agents override extension defaults by name. Agents support `thinking: <level>` in frontmatter (off, minimal, low, medium, high, xhigh). Config `thinking.<role>` overrides the frontmatter value.
|
|
151
216
|
|
|
152
217
|
## API Reference
|
|
153
218
|
|
|
@@ -171,7 +236,7 @@ Crew agents (planner, worker, reviewer, interview-generator, plan-sync) are **au
|
|
|
171
236
|
|
|
172
237
|
| Action | Description |
|
|
173
238
|
|--------|-------------|
|
|
174
|
-
| `plan` | Create plan from PRD (`prd` optional — auto-discovers if omitted) |
|
|
239
|
+
| `plan` | Create plan from PRD or inline prompt (`prd`, `prompt` optional — auto-discovers PRD if omitted, auto-starts workers unless `autoWork: false`) |
|
|
175
240
|
| `work` | Run ready tasks (`autonomous`, `concurrency` optional) |
|
|
176
241
|
| `review` | Review implementation (`target` task ID required) |
|
|
177
242
|
| `task.list` | List all tasks |
|
|
@@ -185,8 +250,8 @@ Crew agents (planner, worker, reviewer, interview-generator, plan-sync) are **au
|
|
|
185
250
|
| `crew.status` | Overall crew status |
|
|
186
251
|
| `crew.validate` | Validate plan dependencies |
|
|
187
252
|
| `crew.agents` | List available crew agents |
|
|
188
|
-
| `crew.install` |
|
|
189
|
-
| `crew.uninstall` | Remove crew
|
|
253
|
+
| `crew.install` | Show discovered crew agents and their sources |
|
|
254
|
+
| `crew.uninstall` | Remove stale shared-directory crew agent copies |
|
|
190
255
|
|
|
191
256
|
### Swarm (Spec-Based)
|
|
192
257
|
|
|
@@ -208,7 +273,8 @@ Create `~/.pi/agent/pi-messenger.json`:
|
|
|
208
273
|
"scopeToFolder": false,
|
|
209
274
|
"nameTheme": "default",
|
|
210
275
|
"stuckThreshold": 900,
|
|
211
|
-
"stuckNotify": true
|
|
276
|
+
"stuckNotify": true,
|
|
277
|
+
"autoOverlayPlanning": true
|
|
212
278
|
}
|
|
213
279
|
```
|
|
214
280
|
|
|
@@ -223,6 +289,8 @@ Create `~/.pi/agent/pi-messenger.json`:
|
|
|
223
289
|
| `stuckThreshold` | Seconds of inactivity before stuck detection | `900` |
|
|
224
290
|
| `stuckNotify` | Show notification when a peer appears stuck | `true` |
|
|
225
291
|
| `autoStatus` | Auto-generate status messages from activity | `true` |
|
|
292
|
+
| `autoOverlay` | Auto-open overlay when autonomous crew work starts | `true` |
|
|
293
|
+
| `autoOverlayPlanning` | Auto-open Crew overlay when planning starts or is restored in-progress | `true` |
|
|
226
294
|
| `crewEventsInFeed` | Include crew task events in activity feed | `true` |
|
|
227
295
|
| `contextMode` | Context injection level: `full`, `minimal`, `none` | `"full"` |
|
|
228
296
|
|
|
@@ -236,7 +304,7 @@ Incoming messages wake the receiving agent via `pi.sendMessage()` with `triggerT
|
|
|
236
304
|
|
|
237
305
|
Crew workers are spawned as `pi --mode json` subprocesses with the agent's system prompt, model, and tool restrictions from their `.md` definitions. Progress is tracked via JSONL streaming — the overlay subscribes to a live progress store that shows each worker's current tool, call count, and token usage in real time. Aborting a work run triggers graceful shutdown: each worker receives an inbox message asking it to stop, followed by a grace period before SIGTERM. The planner and reviewer work the same way — just pi instances with different agent configs.
|
|
238
306
|
|
|
239
|
-
All coordination is file-based, no daemon required.
|
|
307
|
+
All coordination is file-based, no daemon required. Shared state (registry, inboxes, swarm claims/completions) lives in `~/.pi/agent/messenger/`. Activity feed and crew data are project-scoped under `.pi/messenger/` inside your project. Dead agents are detected via PID checks and cleaned up automatically.
|
|
240
308
|
|
|
241
309
|
## Credits
|
|
242
310
|
|
package/config.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface MessengerConfig {
|
|
|
26
26
|
stuckThreshold: number;
|
|
27
27
|
stuckNotify: boolean;
|
|
28
28
|
autoStatus: boolean;
|
|
29
|
+
autoOverlay: boolean;
|
|
30
|
+
autoOverlayPlanning: boolean;
|
|
29
31
|
crewEventsInFeed: boolean;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -42,6 +44,8 @@ const DEFAULT_CONFIG: MessengerConfig = {
|
|
|
42
44
|
stuckThreshold: 900,
|
|
43
45
|
stuckNotify: true,
|
|
44
46
|
autoStatus: true,
|
|
47
|
+
autoOverlay: true,
|
|
48
|
+
autoOverlayPlanning: true,
|
|
45
49
|
crewEventsInFeed: true,
|
|
46
50
|
};
|
|
47
51
|
|
|
@@ -155,6 +159,8 @@ export function loadConfig(cwd: string): MessengerConfig {
|
|
|
155
159
|
stuckThreshold: typeof merged.stuckThreshold === "number" ? merged.stuckThreshold : DEFAULT_CONFIG.stuckThreshold,
|
|
156
160
|
stuckNotify: merged.stuckNotify !== false,
|
|
157
161
|
autoStatus: merged.autoStatus !== false,
|
|
162
|
+
autoOverlay: merged.autoOverlay !== false,
|
|
163
|
+
autoOverlayPlanning: merged.autoOverlayPlanning !== false,
|
|
158
164
|
crewEventsInFeed: merged.crewEventsInFeed !== false,
|
|
159
165
|
};
|
|
160
166
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: crew-planner
|
|
3
3
|
description: Analyzes codebase and PRD to create a comprehensive task breakdown
|
|
4
4
|
tools: read, bash, web_search, pi_messenger
|
|
5
|
-
model: claude-opus-4-
|
|
5
|
+
model: anthropic/claude-opus-4-6
|
|
6
6
|
crewRole: planner
|
|
7
7
|
maxOutput: { bytes: 204800, lines: 5000 }
|
|
8
8
|
parallel: false
|
|
@@ -66,7 +66,7 @@ Create a task breakdown following the exact output format below. Guidelines:
|
|
|
66
66
|
- **4-8 tasks** typically (scale with complexity)
|
|
67
67
|
- Each task should be **completable in one work session**
|
|
68
68
|
- Group related work but keep tasks focused
|
|
69
|
-
-
|
|
69
|
+
- Include tests in each task's acceptance criteria
|
|
70
70
|
- Include specific files to create/modify when known
|
|
71
71
|
- Include acceptance criteria in task descriptions
|
|
72
72
|
|
|
@@ -80,6 +80,22 @@ Tasks execute in waves — all tasks whose dependencies are met run concurrently
|
|
|
80
80
|
- **Dependencies should reflect real data flow.** Task B depends on Task A only if B imports types, calls functions, or reads files that A creates. Conceptual ordering ("settings before server") isn't a dependency unless the server literally imports from the settings module.
|
|
81
81
|
- **Front-load foundation tasks with no dependencies** so multiple streams can start from wave 1.
|
|
82
82
|
|
|
83
|
+
### Anti-Patterns to Avoid
|
|
84
|
+
|
|
85
|
+
- **No standalone "types" or "config" tasks.** If every other task depends on a types-only task, you've created a bottleneck. The first task that needs shared types should define them alongside its real work.
|
|
86
|
+
- **No integration funnels.** A task that depends on everything (tasks 1-5 all as deps) forces serialization. Split integration so pieces can start as each module completes.
|
|
87
|
+
- **No redundant transitive deps.** If B depends on A, and C depends on B, don't list A in C's dependencies — it's already satisfied through B.
|
|
88
|
+
- **Tests belong in their task.** Include unit tests in each implementation task's acceptance criteria. A standalone "Testing" task at the end is always on the critical path.
|
|
89
|
+
|
|
90
|
+
### Dependency Descriptions
|
|
91
|
+
|
|
92
|
+
Be specific about what each dependency provides. Workers may start before dependencies complete and need to know what to expect:
|
|
93
|
+
- Name the **files** each task creates or modifies
|
|
94
|
+
- Name the **exported symbols** (functions, types, classes) other tasks will import
|
|
95
|
+
- Describe **interface shapes** (function signatures, type fields) so workers can code against them even before the dependency is done
|
|
96
|
+
|
|
97
|
+
Workers coordinate via file reservations and direct messages. They can define local interfaces and adapt when dependency outputs appear. Your dependency descriptions help them make good decisions.
|
|
98
|
+
|
|
83
99
|
## Output Format
|
|
84
100
|
|
|
85
101
|
Your final output MUST include both formats:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: crew-reviewer
|
|
3
3
|
description: Reviews task implementations for quality and correctness
|
|
4
4
|
tools: read, bash, pi_messenger
|
|
5
|
-
model:
|
|
5
|
+
model: anthropic/claude-opus-4-6
|
|
6
6
|
crewRole: reviewer
|
|
7
7
|
maxOutput: { bytes: 102400, lines: 2000 }
|
|
8
8
|
parallel: true
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: crew-worker
|
|
3
3
|
description: Implements a single crew task with mesh coordination
|
|
4
4
|
tools: read, write, edit, bash, pi_messenger
|
|
5
|
-
model: claude-
|
|
5
|
+
model: anthropic/claude-haiku-4-5
|
|
6
6
|
crewRole: worker
|
|
7
7
|
maxOutput: { bytes: 204800, lines: 5000 }
|
|
8
8
|
parallel: true
|
|
@@ -54,6 +54,14 @@ pi_messenger({ action: "reserve", paths: ["src/path/to/files/"], reason: "<TASK_
|
|
|
54
54
|
3. Write tests if applicable
|
|
55
55
|
4. Run tests to verify: `bash({ command: "npm test" })` or equivalent
|
|
56
56
|
|
|
57
|
+
**Progress Logging:** After each significant step above, log what you did:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
pi_messenger({ action: "task.progress", id: "<TASK_ID>", message: "Added JWT validation to src/auth/middleware.ts" })
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Keep entries concise — one line per step. This helps the next agent pick up where you left off if the task gets interrupted.
|
|
64
|
+
|
|
57
65
|
## Phase 5: Commit
|
|
58
66
|
|
|
59
67
|
```bash
|
|
@@ -102,3 +110,8 @@ If you receive a message saying "SHUTDOWN REQUESTED":
|
|
|
102
110
|
- ALWAYS release before completing
|
|
103
111
|
- If you encounter a blocker, use `task.block` with a clear reason
|
|
104
112
|
- Follow existing code patterns and conventions
|
|
113
|
+
|
|
114
|
+
## Coordination
|
|
115
|
+
|
|
116
|
+
Follow the coordination instructions in your task prompt's "Coordination" section.
|
|
117
|
+
If no coordination section is present, do not send messages — focus on your task.
|