pi-herdr-agents 1.3.0 → 1.3.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 CHANGED
@@ -7,11 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
9
9
 
10
- ## [v1.3.0](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.2.3...v1.3.0)
10
+ ## [v1.3.1](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.3.0...v1.3.1)
11
+
12
+ ### Commits
13
+
14
+ - fix: recommend tier-first model selection over parent inheritance [`c86e002`](https://github.com/giuseppecrj/pi-herdr-agents/commit/c86e0027d857f3b31c8a9925789baf56203e5bba)
15
+ - docs: align remaining spawn examples with tier-first policy [`776f656`](https://github.com/giuseppecrj/pi-herdr-agents/commit/776f656419f8afe8a998705803cb2d1889218b97)
16
+
17
+ ## [v1.3.0](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.2.3...v1.3.0) - 2026-08-18
11
18
 
12
19
  ### Commits
13
20
 
14
21
  - feat: identify workflow review nodes [`6919ab1`](https://github.com/giuseppecrj/pi-herdr-agents/commit/6919ab1c655f0e6c50944011889df14800cf2021)
22
+ - chore: release v1.3.0 [`36c8187`](https://github.com/giuseppecrj/pi-herdr-agents/commit/36c8187098e24f3d65dc309e19ccd44e6432f8ce)
15
23
 
16
24
  ## [v1.2.3](https://github.com/giuseppecrj/pi-herdr-agents/compare/v1.2.2...v1.2.3) - 2026-08-18
17
25
 
package/README.md CHANGED
@@ -71,8 +71,8 @@ For an isolated writing task:
71
71
  Pi can also call the tool directly:
72
72
 
73
73
  ```typescript
74
- subagent({ name: "Auth scout", agent: "scout", task: "Map the authentication flow" });
75
- subagent({ name: "DB scout", agent: "scout", task: "Map the session schema" });
74
+ subagent({ name: "Auth scout", agent: "scout", model: "<provider>/<fast-tier-id>", thinking: "low", task: "Map the authentication flow" });
75
+ subagent({ name: "DB scout", agent: "scout", model: "<provider>/<fast-tier-id>", thinking: "low", task: "Map the session schema" });
76
76
  // Both return immediately; each result comes back independently.
77
77
  ```
78
78
 
@@ -197,9 +197,15 @@ This package does not install optional prerequisites.
197
197
 
198
198
  Bundled agents use model defaults from `config.json` when configured; otherwise
199
199
  they inherit the parent model. Thinking defaults still come from agent
200
- frontmatter or the parent level. The orchestrating agent can override either
201
- field for a specific task using an exact authenticated model ID and a supported
202
- Pi thinking level. Prefer changing thinking before changing models.
200
+ frontmatter or the parent level. This resolution chain remains available as a
201
+ fallback, but orchestrators should explicitly set each child's exact
202
+ authenticated `provider/model-id` and supported thinking level. Select the
203
+ model tier first: fast for bounded mechanical work and recon, mid for ordinary
204
+ implementation or review, and frontier for architecture, security, hard
205
+ diagnosis, or adversarial review. Then select thinking within that model's
206
+ supported range. Independent reviewers must use a different provider/family
207
+ than the model that produced the work; a stronger model in the same family is a
208
+ quality escalation, not independent review.
203
209
 
204
210
  Discovery loads definitions in **package → global → project** order, so effective
205
211
  priority remains **project** (`.pi/agents/`) > **global**
@@ -340,22 +346,24 @@ status and model configuration are loaded when the extension starts.
340
346
  ## Spawning Subagents
341
347
 
342
348
  ```typescript
343
- // Named agent with defaults from agent definition or config.json
344
- subagent({ name: "Scout", agent: "scout", task: "Analyze the codebase..." });
349
+ // Explicit fast-tier runtime for bounded reconnaissance
350
+ subagent({ name: "Scout", agent: "scout", model: "<provider>/<fast-tier-id>", thinking: "low", task: "Analyze the codebase..." });
345
351
 
346
352
  // Force a full-context fork for this spawn
347
- subagent({ name: "Iterate", fork: true, task: "Fix the bug where..." });
353
+ subagent({ name: "Iterate", fork: true, model: "<provider>/<mid-tier-id>", thinking: "medium", task: "Fix the bug where..." });
348
354
 
349
- // Agent defaults can choose a different session-mode via frontmatter
350
- subagent({ name: "Planner", agent: "planner", task: "Work through the design with me" });
355
+ // Explicit frontier-tier runtime for architecture work
356
+ subagent({ name: "Planner", agent: "planner", model: "<provider>/<frontier-tier-id>", thinking: "high", task: "Work through the design with me" });
351
357
 
352
- // Custom working directory
353
- subagent({ name: "Designer", agent: "game-designer", cwd: "agents/game-designer", task: "..." });
358
+ // Explicit mid-tier runtime with a custom working directory
359
+ subagent({ name: "Designer", agent: "game-designer", model: "<provider>/<mid-tier-id>", thinking: "medium", cwd: "agents/game-designer", task: "..." });
354
360
 
355
361
  // Isolated ticket branch in a Herdr-managed Git worktree
356
362
  subagent({
357
363
  name: "Ticket 123",
358
364
  agent: "worker",
365
+ model: "<provider>/<mid-tier-id>",
366
+ thinking: "medium",
359
367
  worktree: { branch: "ticket/123", base: "main" },
360
368
  task: "Implement ticket 123, test it, and commit the result",
361
369
  });
@@ -371,7 +379,7 @@ subagent({
371
379
  | `fork` | boolean | `false` | Force the full-context fork mode for this spawn, overriding any agent `session-mode` frontmatter |
372
380
  | `interactive` | boolean | derived | Mark this spawn as interactive (don't wake the parent on stall/recovery). Defaults to the agent's `interactive` frontmatter, otherwise the inverse of `auto-exit`. |
373
381
  | `model` | string | configured or parent | Exact authenticated `provider/model-id`, or an ordered comma-separated Pi fallback list; fallback lists are unavailable for worktree spawns. Resolution is tool argument → agent frontmatter → per-agent config → global config → parent |
374
- | `thinking` | string | parent level | Pi thinking level (`off` through `max`); omit to inherit the parent |
382
+ | `thinking` | string | parent level | Pick the model tier first, then set thinking within that model's range: minimal/low for bounded mechanical work, medium for ordinary implementation or review, high+ for architecture, security, or hard diagnosis. Omitting still inherits the parent level; this is a discouraged fallback for orchestrated children. |
375
383
  | `systemPrompt` | string | — | Role/system-prompt text for a bare spawn; named agents keep their definition body |
376
384
  | `skills` | string | — | Comma-separated skill names |
377
385
  | `tools` | string | — | Comma-separated tool names |
@@ -132,7 +132,9 @@ the package's `/plan` workflow, not as a second kind of subagent definition.
132
132
  A role describes the work; a runtime describes which authenticated Pi
133
133
  provider/model and thinking level one invocation uses. The model-resolution
134
134
  chain is explicit invocation choice, agent default, per-agent configuration,
135
- global configuration, then the parent model.
135
+ global configuration, then the parent model. Inheritance is the resolver fallback,
136
+ not the orchestrator default; independent review requires a different
137
+ provider/family than the model that produced the work.
136
138
 
137
139
  Apply these rules:
138
140
 
@@ -10,6 +10,8 @@ Run Pi inside Herdr from a Git checkout, then give each independent writing task
10
10
  subagent({
11
11
  name: "Ticket 123",
12
12
  agent: "worker",
13
+ model: "<worker-provider>/<mid-tier-id>",
14
+ thinking: "medium",
13
15
  cwd: "/path/to/repository",
14
16
  worktree: { branch: "ticket/123", base: "main" },
15
17
  task: "Implement ticket 123, run its tests, commit the result, and report the commit SHA. Do not push, merge, or remove the worktree.",
@@ -28,6 +30,8 @@ Use an ordinary subagent pane instead when the task is read-only, interactive, o
28
30
  subagent({
29
31
  name: "Scout auth",
30
32
  agent: "scout",
33
+ model: "<scout-provider>/<fast-tier-id>",
34
+ thinking: "low",
31
35
  task: "Map the auth flow; do not modify files.",
32
36
  });
33
37
  ```
@@ -70,6 +74,8 @@ Independent tasks can launch concurrently from the same committed base:
70
74
  subagent({
71
75
  name: "API ticket",
72
76
  agent: "worker",
77
+ model: "<worker-provider>/<mid-tier-id>",
78
+ thinking: "medium",
73
79
  worktree: { branch: "tickets/api", base: "main" },
74
80
  task: "Implement the API ticket, test it, and commit. Do not push or merge.",
75
81
  });
@@ -77,6 +83,8 @@ subagent({
77
83
  subagent({
78
84
  name: "UI ticket",
79
85
  agent: "worker",
86
+ model: "<worker-provider>/<mid-tier-id>",
87
+ thinking: "medium",
80
88
  worktree: { branch: "tickets/ui", base: "main" },
81
89
  task: "Implement the UI ticket, test it, and commit. Do not push or merge.",
82
90
  });
@@ -138,6 +146,8 @@ For parallel read-only review, prepare one stable existing checkout of the pull
138
146
  subagent({
139
147
  name: "PR reviewer",
140
148
  agent: "reviewer",
149
+ model: "<review-provider>/<mid-tier-id>",
150
+ thinking: "medium",
141
151
  cwd: "/path/to/pr-checkout",
142
152
  task: "Review base <base-sha> through head <head-sha>. First report git rev-parse HEAD. Do not modify files.",
143
153
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-herdr-agents",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Asynchronous Pi subagents and approved review workflows in Herdr, with optional isolated Git worktrees",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -169,9 +169,10 @@ function getFirstText(
169
169
 
170
170
  function buildSubagentRoutingGuidelines(catalog?: string): string[] {
171
171
  return [
172
- "For subagent model and thinking selection, inherit the parent runtime by omitting both fields unless the task warrants an override.",
173
- "For subagent tasks, prefer changing thinking before changing models: minimal/low for bounded mechanical work, medium for ordinary implementation or review, and high+ for architecture, concurrency, security, or hard diagnosis.",
174
- "When overriding a subagent model, use an exact authenticated provider/model-id from the live catalog below. Do not invent aliases or fuzzy names.",
172
+ "For orchestrated subagent work, explicitly set both model and thinking for every child: first choose a fast, mid, or frontier provider-family tier matched to task complexity, then set thinking within that model's supported range.",
173
+ "Use fast tier for bounded mechanical work and recon, mid tier for ordinary implementation or review, and frontier tier for architecture, security, hard diagnosis, or adversarial review. Use minimal/low thinking for mechanical work, medium for ordinary work, and high+ for hard work.",
174
+ "Review agents must use a different provider/family than the model that produced the work; a stronger model in the same family is quality escalation, not independent review. Use an exact authenticated provider/model-id from the live catalog below, never an alias or fuzzy name.",
175
+ "Omitting model and thinking still inherits the parent runtime, but this is a discouraged fallback for orchestrated children.",
175
176
  "Before launching a new group of subagents, choose a short task slug and name each new child <task>-<role>[-n], for example login-api or login-test2. Use only plan, research, ui, api, build, test, review, browser, security, perf, or merge as roles; leave existing names unchanged. After the final launch, print name | agent kind | role | model | worktree, then use each name in prompts, handoffs, and results.",
176
177
  catalog ??
177
178
  "Authenticated subagent model catalog becomes available after session start.",
@@ -184,7 +185,7 @@ const ThinkingLevelSchema = Type.Union(
184
185
  THINKING_LEVELS.map((level) => Type.Literal(level)),
185
186
  {
186
187
  description:
187
- "Pi thinking level. Omit to inherit the parent level. Prefer changing thinking before changing models: minimal/low for bounded mechanical work, medium for ordinary implementation or review, high+ for architecture, concurrency, security, or hard diagnosis.",
188
+ "Pi thinking level. Pick the model tier first, then set thinking within that model's range: minimal/low for bounded mechanical work, medium for ordinary implementation or review, high+ for architecture, security, or hard diagnosis. Omitting still inherits the parent level; do not omit on orchestrated child work.",
188
189
  },
189
190
  );
190
191
 
@@ -209,7 +210,7 @@ const SubagentParams = Type.Object({
209
210
  model: Type.Optional(
210
211
  Type.String({
211
212
  description:
212
- "Exact authenticated provider/model-id, or an ordered comma-separated fallback list. Omit to inherit the parent model. Fallbacks are Pi-backed only and cannot be used with worktrees.",
213
+ "Explicitly pick an exact authenticated provider/model-id in a fast, mid, or frontier provider-family tier matched to the task, or use an ordered comma-separated fallback list. Review must use a different provider/family than the producing model. Omitting still inherits the parent model; do not omit for orchestrated children. Fallbacks are Pi-backed only and cannot be used with worktrees.",
213
214
  }),
214
215
  ),
215
216
  thinking: Type.Optional(ThinkingLevelSchema),
@@ -38,6 +38,10 @@ Phase 7: Review
38
38
 
39
39
  ---
40
40
 
41
+ ## Runtime
42
+
43
+ Set `model` and `thinking` on every spawn. Use an exact authenticated provider/model ID: a fast-tier model for scouts, a mid-tier model for ordinary workers, and a frontier-tier model only for architecture or hard diagnosis. Reviewers must use a different provider/family than workers. Do not omit `model` in this workflow.
44
+
41
45
  ## Fire-and-forget completion
42
46
 
43
47
  `subagent` is fire-and-forget. After each spawn:
@@ -83,6 +87,8 @@ Standard filenames:
83
87
  subagent({
84
88
  name: "🔍 Scout",
85
89
  agent: "scout",
90
+ model: "<scout-provider>/<fast-tier-id>",
91
+ thinking: "low",
86
92
  task: `Analyze the codebase for [user's request area]. Map file structure, key modules, patterns, conventions, and existing code related to [feature area]. Focus on what a planner would need to understand before designing this feature.
87
93
 
88
94
  Put your full findings in your final assistant message.`,
@@ -105,6 +111,8 @@ Spawn the interactive planner with the scout's context and the user's request. T
105
111
  subagent({
106
112
  name: "💬 Planner",
107
113
  agent: "planner",
114
+ model: "<planner-provider>/<frontier-tier-id>",
115
+ thinking: "high",
108
116
  interactive: true,
109
117
  task: `Plan: [what the user wants to build]
110
118
 
@@ -132,6 +140,8 @@ If the planner significantly changed scope (new subsystems, areas the original s
132
140
  subagent({
133
141
  name: "🔍 Scout (updated scope)",
134
142
  agent: "scout",
143
+ model: "<scout-provider>/<fast-tier-id>",
144
+ thinking: "low",
135
145
  task: "The plan changed scope. Gather context for [new areas]. Read the plan at [plan path]. Focus on [specific files/modules the planner identified that weren't in the original scout]. Put findings in your final assistant message.",
136
146
  });
137
147
  ```
@@ -171,6 +181,8 @@ Sequential example:
171
181
  subagent({
172
182
  name: "🔨 Worker 1/N",
173
183
  agent: "worker",
184
+ model: "<worker-provider>/<mid-tier-id>",
185
+ thinking: "medium",
174
186
  task: `Implement Task 1 from the plan.
175
187
 
176
188
  Plan: [plan path]
@@ -187,6 +199,8 @@ For independent writing tasks, first ensure their shared base is committed. The
187
199
  subagent({
188
200
  name: "🔨 Task-1",
189
201
  agent: "worker",
202
+ model: "<worker-provider>/<mid-tier-id>",
203
+ thinking: "medium",
190
204
  cwd: "/absolute/path/to/source-repo",
191
205
  worktree: { branch: "plan-name/task-1", base: "HEAD" },
192
206
  task: `Implement Task 1.
@@ -229,6 +243,8 @@ After all shared-checkout changes and accepted worktree results are integrated:
229
243
  subagent({
230
244
  name: "Reviewer",
231
245
  agent: "reviewer",
246
+ model: "<review-provider>/<mid-tier-id>",
247
+ thinking: "medium",
232
248
  interactive: false,
233
249
  task: "Review the recent changes. Plan: [plan path]. Put the full review in your final assistant message.",
234
250
  });
@@ -336,12 +336,12 @@ export function buildAuthenticatedModelCatalog(
336
336
  ].filter(Boolean);
337
337
  lines.push(`- ${model.provider}/${model.id} — ${facts.join(", ")}`);
338
338
  }
339
- if (models.length === 0) lines.push("- none discovered; inherit the parent runtime");
339
+ if (models.length === 0) lines.push("- none discovered; omitting model still inherits the parent runtime");
340
340
  if (models.length > visibleModels.length) {
341
341
  lines.push(`- … ${models.length - visibleModels.length} more authenticated models omitted`);
342
342
  }
343
343
  lines.push(
344
- "Default: inherit the parent model and thinking. Override thinking first; override model only when task capability, speed, cost, modality, or context warrants it.",
344
+ "For orchestrated children, explicitly select an exact provider/model-id by task tier first (fast for bounded mechanical work and recon, mid for ordinary implementation or review, frontier for architecture, security, hard diagnosis, or adversarial review), then set supported thinking. Reviews must use a different provider/family than the producing model. Omitting model and thinking inherits the parent runtime as a discouraged fallback.",
345
345
  );
346
346
  return lines.join("\n");
347
347
  }
@@ -43,7 +43,14 @@ role. Every declared role must be Pi-backed and have a non-empty read-only tool
43
43
  set after runner derivation. Use bounded caps no higher than `maxAgents: 8` and
44
44
  `maxConcurrency: 4`; leave enough agent calls for one synthesizer and any
45
45
  permitted replacement. Exact model and thinking are mandatory for every node.
46
- Never inherit, guess, or fall back to a parent or role default.
46
+ Pick each node's exact authenticated `provider/model-id` by the tier matched to
47
+ its task: fast for bounded mechanical work and recon, mid for ordinary review,
48
+ and frontier for architecture or hard diagnosis. Then set thinking within that
49
+ model's supported range. When more than one provider is authenticated,
50
+ independent reviewer nodes must use a different provider/family than the model
51
+ that produced the work; do not reuse that family for its review. Never inherit,
52
+ guess, or fall back to a parent or role default. Do not add tier fields to
53
+ workflow metadata; each node continues to pin its exact provider/model.
47
54
 
48
55
  The first flow is review-only. Do not plan writers, commits, worktrees for
49
56
  writing, ticket changes, pull requests, merges, deployments, publishing,