pi-open-agents 0.1.17 โ 0.1.19
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 +43 -1
- package/package.json +1 -1
- package/src/subagent/executor.ts +6 -3
- package/src/subagent/tool.ts +15 -1
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ Unified agent and subagent management for [pi](https://pi.dev), with [OpenCode](
|
|
|
13
13
|
Replaces `pi-agent-mode` + `@johnnywu/pi-subagents` with one coherent plugin.
|
|
14
14
|
|
|
15
15
|
> **Why pi?** Pi's minimalist core keeps system prompts under 1,000 tokens โ making it exceptionally fast on local models and cheap on cloud APIs. pi-open-agents is built to leverage that minimalism. See [Pi vs OpenCode: Performance & Architecture](./PI-VS-OPencode.md) for a detailed comparison.
|
|
16
|
+
>
|
|
17
|
+
> ๐ **Herd your agents.** pi-open-agents + [Herdr](https://herdr.dev) runs a full team of coding agents โ persistent workspaces, live agent awareness, control from one screen. **[Set up the stack in 5 commands โ](./PI-WITH-HERDR.md)**
|
|
16
18
|
|
|
17
19
|
---
|
|
18
20
|
|
|
@@ -82,6 +84,23 @@ have no permission system. `pi-open-agents` replaces both:
|
|
|
82
84
|
|
|
83
85
|
---
|
|
84
86
|
|
|
87
|
+
## Popular requests, already covered
|
|
88
|
+
|
|
89
|
+
Some of the most upvoted agent/subagent asks across the ecosystem are already
|
|
90
|
+
here โ or native in pi itself:
|
|
91
|
+
|
|
92
|
+
| Asked elsewhere (๐) | Status in pi + pi-open-agents |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `AGENTS.md` adoption โ anthropics/claude-code#31005 ๐336, openai/codex#12115 ๐109 | โ
Native in pi: `AGENTS.md`/`CLAUDE.md` discovery with `AGENTS.override.md` layering |
|
|
95
|
+
| Agent Skills standard (`.agents/skills/`) โ agentskills/agentskills#15 ๐183 | โ
Native in pi; shared agents from `.agents/` (#7 aligns to the dotagents layout) |
|
|
96
|
+
| Tool restrictions that actually reach subagents โ anthropics/claude-code#18950 ๐70 | โ
Since v0.1.14, `tools:`/`permission:` restrict the child toolset via `--tools` (full parent inheritance โ #8) |
|
|
97
|
+
| Model selection per subagent / per call โ sst/opencode#6651 ๐71 | โ
Per-agent `model:` + per-call `model:` override in `subagent()` (since v0.1.19) |
|
|
98
|
+
| Reasoning effort per agent โ Kilo-Org/kilocode#13105 ๐8 | โ
`thinking: offโฆxhigh` per agent, forwarded to the child process |
|
|
99
|
+
| Delegation guards โ Kilo-Org/kilocode#9985 | โ
`allowedAgents` allowlist + `maxDepth` recursion limit |
|
|
100
|
+
| Agent management UI โ openai/codex#22321 ๐41 | โ
`/agent`, `/agents`, `/agent-search`, `Ctrl+Shift+M`, programmatic `set_agent` |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
85
104
|
## Features
|
|
86
105
|
|
|
87
106
|
### Per-agent model, thinking, and permissions
|
|
@@ -135,7 +154,7 @@ If an agent has the `subagent` tool, the plugin automatically appends a
|
|
|
135
154
|
subagents and the correct call syntax:
|
|
136
155
|
|
|
137
156
|
```
|
|
138
|
-
subagent({ agent: "<name>", task: "<task>" })
|
|
157
|
+
subagent({ agent: "<name>", task: "<task>", cwd?, session?, model? })
|
|
139
158
|
```
|
|
140
159
|
|
|
141
160
|
You never need to explain delegation mechanics in agent prompts. The plugin
|
|
@@ -152,6 +171,11 @@ This means:
|
|
|
152
171
|
- Each subagent runs with exactly the model and tools it declares
|
|
153
172
|
- Skills load per-agent, with wildcard support (`security-*`, `git-*`)
|
|
154
173
|
|
|
174
|
+
**Per-call model override:** the caller can override the agent's default for a
|
|
175
|
+
single call โ `subagent({ agent: "deep-research", task: "...", model: "zai/glm-5.3-flash" })`.
|
|
176
|
+
Handy for "run this one task on the cheap model" without forking an agent
|
|
177
|
+
definition. Malformed values (`no-slash`) are rejected before any spawn.
|
|
178
|
+
|
|
155
179
|
The `--tools` whitelist is derived from both explicit `tools:` arrays and
|
|
156
180
|
permission allow-lists. An agent with `permission: { read: allow, edit: allow }`
|
|
157
181
|
will only get `read` and `edit` in the child process. Wildcard permissions
|
|
@@ -290,6 +314,24 @@ Optional cleanup:
|
|
|
290
314
|
|
|
291
315
|
---
|
|
292
316
|
|
|
317
|
+
## Run a fleet ๐
|
|
318
|
+
|
|
319
|
+
Pi stays minimal on purpose โ one agent, done well. When you need **many**,
|
|
320
|
+
add [Herdr](https://herdr.dev): persistent workspaces, mouse-first UX, live
|
|
321
|
+
agent awareness (`idle` / `working` / `blocked`), and cross-agent control
|
|
322
|
+
from one screen โ pi, or any mix of the 25 supported agent kinds. Six agents,
|
|
323
|
+
six sessions, zero chaos: that's the exact workstation setup documented in
|
|
324
|
+
**[pi ร Herdr ร pi-open-agents](./PI-WITH-HERDR.md)**.
|
|
325
|
+
|
|
326
|
+
## Roadmap
|
|
327
|
+
|
|
328
|
+
- **Parent permission inheritance** for subagents โ #8
|
|
329
|
+
- **Agent hot-reload** (or `/reload-agents`) โ #9
|
|
330
|
+
- ~~**Per-call model override** in `subagent()`~~ โ โ
shipped in [0.1.19](https://github.com/andrea-tomassi/pi-open-agents/releases/tag/v0.1.19) (#10)
|
|
331
|
+
- **Parallel subagent limit** โ #11
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
293
335
|
## Development
|
|
294
336
|
|
|
295
337
|
**Contributing?** Please read the [Contributing Guide](./CONTRIBUTING.md) before
|
package/package.json
CHANGED
package/src/subagent/executor.ts
CHANGED
|
@@ -113,6 +113,8 @@ export interface RunSubagentOptions {
|
|
|
113
113
|
outputArchiveDir?: string;
|
|
114
114
|
agentDir?: string;
|
|
115
115
|
session?: SubagentSessionInfo;
|
|
116
|
+
/** Per-call model override ("provider/model-id"). Takes precedence over agent.model. */
|
|
117
|
+
modelOverride?: string;
|
|
116
118
|
resolvePi?: () => Promise<PiResolution> | PiResolution;
|
|
117
119
|
runner?: ProcessRunner;
|
|
118
120
|
fs?: ExecutorFs;
|
|
@@ -504,9 +506,10 @@ export async function runSubagent(options: RunSubagentOptions): Promise<AgentRes
|
|
|
504
506
|
args.push("--no-context-files");
|
|
505
507
|
}
|
|
506
508
|
|
|
507
|
-
// Model override
|
|
508
|
-
|
|
509
|
-
|
|
509
|
+
// Model: per-call override wins over the agent definition default
|
|
510
|
+
const modelId = options.modelOverride ?? options.agent.model;
|
|
511
|
+
if (modelId) {
|
|
512
|
+
args.push("--model", modelId);
|
|
510
513
|
}
|
|
511
514
|
|
|
512
515
|
// Thinking level
|
package/src/subagent/tool.ts
CHANGED
|
@@ -47,6 +47,7 @@ interface SubagentParams {
|
|
|
47
47
|
task: string;
|
|
48
48
|
cwd?: string;
|
|
49
49
|
session?: SubagentSessionMode;
|
|
50
|
+
model?: string;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
// โโโ Helpers โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
@@ -199,7 +200,7 @@ export function registerSubagentTool(
|
|
|
199
200
|
name: "subagent",
|
|
200
201
|
label: "Subagent",
|
|
201
202
|
description: "Delegate a task to a named sub-agent running in an isolated pi process.",
|
|
202
|
-
promptSnippet: "Delegate isolated tasks with subagent({ agent, task, cwd?, session? }).",
|
|
203
|
+
promptSnippet: "Delegate isolated tasks with subagent({ agent, task, cwd?, session?, model? }).",
|
|
203
204
|
promptGuidelines,
|
|
204
205
|
parameters: Type.Object({
|
|
205
206
|
agent: Type.String({ description: "Name of the agent to invoke" }),
|
|
@@ -210,6 +211,11 @@ export function registerSubagentTool(
|
|
|
210
211
|
description: 'Parent session handling: none starts a fresh subagent session, fork branches from the current session',
|
|
211
212
|
}),
|
|
212
213
|
),
|
|
214
|
+
model: Type.Optional(
|
|
215
|
+
Type.String({
|
|
216
|
+
description: 'Per-call model override in "provider/model-id" format (e.g. "anthropic/claude-sonnet-4-5"). Takes precedence over the agent definition default.',
|
|
217
|
+
}),
|
|
218
|
+
),
|
|
213
219
|
}),
|
|
214
220
|
|
|
215
221
|
async execute(
|
|
@@ -237,6 +243,13 @@ export function registerSubagentTool(
|
|
|
237
243
|
}
|
|
238
244
|
|
|
239
245
|
const childCwd = params.cwd ?? ctx.cwd;
|
|
246
|
+
|
|
247
|
+
if (params.model !== undefined && !/^[^/\s]+\/[^/\s]+$/.test(params.model)) {
|
|
248
|
+
throw new Error(
|
|
249
|
+
`Invalid model "${params.model}": expected "provider/model-id" format (e.g. "anthropic/claude-sonnet-4-5").`,
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
240
253
|
const session = resolveSubagentSession(
|
|
241
254
|
params.session,
|
|
242
255
|
childCwd,
|
|
@@ -254,6 +267,7 @@ export function registerSubagentTool(
|
|
|
254
267
|
availableAgents: availableSubagentsForAgent(agent, availableSubagents),
|
|
255
268
|
agentDir: options.agentDir,
|
|
256
269
|
session,
|
|
270
|
+
modelOverride: params.model,
|
|
257
271
|
onProgress: (progress) => onUpdate?.(toProgressResult(progress)),
|
|
258
272
|
});
|
|
259
273
|
|