pi-subagent-manager 1.6.0 → 1.7.0

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/agents/coder.md CHANGED
@@ -8,6 +8,7 @@ modelSuggestions:
8
8
  - sonnet-5.5
9
9
  - gpt-6.1-sol
10
10
  - kimi-k3.1-pro
11
+ - muse-wonder-full-1.0
11
12
  tools:
12
13
  allow:
13
14
  - read
@@ -5,6 +5,7 @@ description: Evidence-backed local/remote codebase and internet research; source
5
5
  modelSuggestions:
6
6
  - gpt-6.1-terra
7
7
  - sonnet-5.5
8
+ - muse-spark-1.3
8
9
  thinkingLevel: medium
9
10
  color: syntaxVariable
10
11
  tools:
@@ -9,6 +9,7 @@ modelSuggestions:
9
9
  - sonnet-5.5
10
10
  - opus-5.5
11
11
  - glm-5.3
12
+ - gemini-4-argon
12
13
  tools:
13
14
  allow:
14
15
  - read
package/agents/tasker.md CHANGED
@@ -7,6 +7,7 @@ color: success
7
7
  modelSuggestions:
8
8
  - gpt-6-luna
9
9
  - haiku-5.5
10
+ - deepseek-v4.1-flash-1017
10
11
  tools:
11
12
  allow:
12
13
  - read
@@ -43,14 +43,21 @@ Every `modelSuggestions` entry is a single plain model-name string suitable for
43
43
  | Role | Suggested names, in order | Rationale |
44
44
  | ---------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45
45
  | architect | `opus-5.5`, `gpt-6-astra`, `fable-5.1`, `kimi-k3` | Heavyweight, quality-first reasoning for ambiguous architecture, difficult constraints, and consequential plans; Kimi is the user-selected long-context alternative. |
46
- | coder | `sonnet-5.5`, `gpt-6.1-sol`, `kimi-k3.1-pro` | User-selected implementation shortlist, with high thinking by default. |
47
- | researcher | `gpt-6.1-terra`, `sonnet-5.5` | User-selected research shortlist, with medium thinking by default; no matched research-citation tournament is claimed. |
48
- | reviewer | `gpt-6.1-sol`, `sonnet-5.5`, `opus-5.5`, `glm-5.3` | Reasoning and code evidence, without treating premium Astra as necessary for every review. |
49
- | tasker | `gpt-6-luna`, `haiku-5.5` | User-selected bounded-task shortlist, with low thinking by default. |
46
+ | coder | `sonnet-5.5`, `gpt-6.1-sol`, `kimi-k3.1-pro`, `muse-wonder-full-1.0` | User-selected implementation shortlist, with high thinking by default. |
47
+ | researcher | `gpt-6.1-terra`, `sonnet-5.5`, `muse-spark-1.3` | User-selected research shortlist, with medium thinking by default; no matched research-citation tournament is claimed. |
48
+ | reviewer | `gpt-6.1-sol`, `sonnet-5.5`, `opus-5.5`, `glm-5.3`, `gemini-4-argon` | Reasoning and code evidence, without treating premium Astra as necessary for every review. |
49
+ | tasker | `gpt-6-luna`, `haiku-5.5`, `deepseek-v4.1-flash-1017` | User-selected bounded-task shortlist, with low thinking by default. |
50
50
  | writer | `opus-5.5`, `gemini-4-argon`, `gemini-3.8-flash`, `fable-5.1`, `muse-spark-1.3` | Quality-sensitive editorial work, creative-writing Arena candidates, low-cost drafting, and a user-selected Muse alternative. |
51
51
 
52
52
  These are choices, not an automatic fallback/escalation chain or a universal quality ranking. Model aliases were checked against `pi --list-models`, including `claude-haiku-5-5`, `claude-sonnet-5-5`, and `moonshotai/kimi-k3.1-pro`; fuzzy suggestions omit provider paths and normalize version separators. The historical audit is not a new benchmark evaluation of these updates. Deep-research product results are not automatically results for their underlying base models.
53
53
 
54
+ The November 4, 2026 additions were checked against provider sources and the current catalog:
55
+
56
+ - Tasker uses `deepseek-v4.1-flash-1017`, the latest V4.1 Flash weight revision. [DeepSeek](https://api-docs.deepseek.com/) serves it through `deepseek-flash`; Pi and OpenRouter also list the explicit `deepseek/deepseek-v4.1-flash-1017` identifier.
57
+ - Coder adds `muse-wonder-full-1.0`, the exact identifier in [Meta’s Wonder model table](https://dev.meta.ai/models/muse-wonder). Full is a distinct, Muse Code subscription-only variant, not ordinary Wonder at max reasoning effort. It is an advisory suggestion and may not match a model available in Pi; it does not imply public Model API access.
58
+ - Researcher adds `muse-spark-1.3`, [Meta’s recommended current Spark version](https://dev.meta.ai/docs/models), not the separate Spark Open model.
59
+ - Reviewer adds `gemini-4-argon` (`google/gemini-4-argon` in the [OpenRouter catalog](https://openrouter.ai/api/v1/models)); writer already includes it. Existing suggestions and thinking defaults are preserved.
60
+
54
61
  ### Quality, price, and speed are different axes
55
62
 
56
63
  - Prefer independent task measurements alongside official releases/pricing. Arena is preference evidence, not proof of code correctness, security review, factuality, or citation fidelity. Vendor and independent benchmarks with different harnesses or thinking settings are not directly comparable.
package/docs/settings.md CHANGED
@@ -189,7 +189,7 @@ Which model an agent gets when its session starts.
189
189
 
190
190
  - Types with no `models` inherit the parent's model in both Pick First modes.
191
191
  - Your list's order decides, not the scoped list's order.
192
- - No match → spawn fails clearly. An empty `/scoped-models` matches nothing.
192
+ - No match → spawn fails clearly. An empty `/scoped-models` means unrestricted: all available models are eligible.
193
193
  - `use-current` always uses the **main** session's model, even for nested or reopened agents. Thinking levels stay per-agent.
194
194
  - `modelSuggestions` never affects this.
195
195
  - Switching modes doesn't change already-open sessions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-subagent-manager",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Hierarchical, steerable subagent threads for pi",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,12 +36,7 @@ import type {
36
36
  SubagentExtensionSelection,
37
37
  ToolFilteringMode,
38
38
  } from "../prefs/settings.ts";
39
- import {
40
- modelIdentity,
41
- getModelPreferences,
42
- selectPreferredModel,
43
- ModelPreferenceError,
44
- } from "../prefs/models.ts";
39
+ import { modelIdentity, getModelPreferences, selectPreferredModel } from "../prefs/models.ts";
45
40
  import {
46
41
  THINKING_LEVELS,
47
42
  type AgentType,
@@ -219,27 +214,18 @@ export function createDriverFactory(
219
214
  const available = new Set(availableModelCandidates().map(({ model }) => modelIdentity(model)));
220
215
  return scopedModels.filter(({ model }) => available.has(modelIdentity(model)));
221
216
  };
217
+ // Pi represents an unrestricted scope with an empty array.
222
218
  const selectTypeModelPreference = (
223
219
  type: AgentType,
224
- candidates: readonly { model: { provider: string; id: string } }[],
220
+ scopedModels: readonly ScopedModel[],
225
221
  filtering: boolean,
226
222
  ) => {
227
- try {
228
- return selectPreferredModel(type, candidates, filtering);
229
- } catch (error) {
230
- if (
231
- filtering &&
232
- candidates.length === 0 &&
233
- error instanceof Error &&
234
- !error.message.includes("[]")
235
- ) {
236
- const message = `${error.message} Current /scoped-models scope: [].`;
237
- throw error instanceof ModelPreferenceError
238
- ? new ModelPreferenceError(message, error.scopedModelFiltering)
239
- : new Error(message);
240
- }
241
- throw error;
242
- }
223
+ const restricted = filtering && scopedModels.length > 0;
224
+ return selectPreferredModel(
225
+ type,
226
+ restricted ? availableScopedModels(scopedModels) : availableModelCandidates(),
227
+ restricted,
228
+ );
243
229
  };
244
230
  // Discovery and new/restored drivers share model selection and thinking inheritance.
245
231
  const resolveInitialSettings = (
@@ -260,11 +246,8 @@ export function createDriverFactory(
260
246
  id = ctx.model?.id;
261
247
  } else if (preferences !== undefined) {
262
248
  const filtering = mode === "pick-first-scoped";
263
- const candidates = filtering
264
- ? availableScopedModels(normalizeScopedModels(ctx.scopedModels))
265
- : availableModelCandidates();
266
249
  ({ provider, id } = parseModelIdentity(
267
- selectTypeModelPreference(type, candidates, filtering)!,
250
+ selectTypeModelPreference(type, normalizeScopedModels(ctx.scopedModels), filtering)!,
268
251
  ));
269
252
  } else if (restored?.model) {
270
253
  provider = restored.model.provider;
@@ -372,9 +355,9 @@ export function createDriverFactory(
372
355
  modelSelection === "use-current" ? undefined : getModelPreferences(options.type);
373
356
  const filteringEnabled = () => getModelSelection() === "pick-first-scoped";
374
357
  const selectModelPreference = (
375
- candidates: readonly { model: { provider: string; id: string } }[],
358
+ scopedModels: readonly ScopedModel[],
376
359
  filtering = filteringEnabled(),
377
- ) => selectTypeModelPreference(options.type, candidates, filtering);
360
+ ) => selectTypeModelPreference(options.type, scopedModels, filtering);
378
361
  const initialScopedModels = normalizeScopedModels(ctx.scopedModels);
379
362
  const { provider, id, thinkingLevel } = resolveInitialSettings(
380
363
  options.type,
@@ -721,10 +704,7 @@ export function createDriverFactory(
721
704
  liveScopedModels: readonly ScopedModel[],
722
705
  ) => {
723
706
  if (!filteringEnabled() || modelPreferences === undefined) return;
724
- const preferredIdentity = selectModelPreference(
725
- availableScopedModels(liveScopedModels),
726
- true,
727
- );
707
+ const preferredIdentity = selectModelPreference(liveScopedModels, true);
728
708
  if (!preferredIdentity) return;
729
709
  if (!currentIdentity) throw new Error(`Subagent ${options.path} has no selected model`);
730
710
  if (currentIdentity !== preferredIdentity) {
@@ -751,10 +731,7 @@ export function createDriverFactory(
751
731
  updateResolved();
752
732
  return;
753
733
  }
754
- const preferredIdentity = selectModelPreference(
755
- availableScopedModels(liveScopedModels),
756
- true,
757
- );
734
+ const preferredIdentity = selectModelPreference(liveScopedModels, true);
758
735
  if (!preferredIdentity) {
759
736
  updateResolved();
760
737
  return;
@@ -862,7 +839,9 @@ export function createDriverFactory(
862
839
  let disposed = false;
863
840
  let running = false;
864
841
  let aborted = false;
865
- let baseline = session.messages.length;
842
+ // Compaction can replace session.messages during a prompt, invalidating any saved index.
843
+ const promptResult: { lastAssistant?: AssistantMessage } = {};
844
+ const getLastAssistant = () => promptResult.lastAssistant;
866
845
  // Subscribe after inherited/restored history is loaded; only new assistant events are counted.
867
846
  let settledInput = 0;
868
847
  let settledOutput = 0;
@@ -907,6 +886,8 @@ export function createDriverFactory(
907
886
  );
908
887
  const unsubscribe = session.subscribe((event) => {
909
888
  transcript.accept(event);
889
+ if (running && event.type === "message_end" && event.message.role === "assistant")
890
+ promptResult.lastAssistant = event.message;
910
891
  if (event.type === "tool_execution_start")
911
892
  emit("activity", `Tool: ${event.toolName}`, toolArgumentSnippet(event.args));
912
893
  if (event.type === "tool_execution_end")
@@ -967,17 +948,14 @@ export function createDriverFactory(
967
948
  if (running) throw new Error("Subagent is already running; use steer instead");
968
949
  running = true;
969
950
  aborted = false;
970
- baseline = session.messages.length;
951
+ promptResult.lastAssistant = undefined;
971
952
  finalOutput = "";
972
953
  try {
973
954
  await enforceScopedModelPolicy();
974
955
  await resumePending();
975
956
  await session.prompt(message, { expandPromptTemplates: false });
976
957
  await session.waitForIdle();
977
- const last = session.messages
978
- .slice(baseline)
979
- .filter((msg) => msg.role === "assistant")
980
- .at(-1);
958
+ const last = getLastAssistant();
981
959
  if (aborted || last?.stopReason === "aborted") throw new Error("Subagent run aborted");
982
960
  if (last?.stopReason === "error")
983
961
  throw new Error(last.errorMessage || "Subagent model failed");
@@ -23,8 +23,9 @@ edit. Only these frontmatter keys are accepted:
23
23
  - name: required safe ID matching /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.
24
24
  - description: required nonempty routing description (what work this agent is for).
25
25
  - models: optional NONEMPTY ordered YAML array of exact provider/model-id identities.
26
- First preference present in the CURRENT /scoped-models list wins. Matching is verbatim,
27
- not fuzzy. None matching (including empty scope) FAILS; there is no provider fallback.
26
+ First available preference in the CURRENT /scoped-models list wins. An empty scope is
27
+ unrestricted, so any available model is eligible. Matching is verbatim, not fuzzy.
28
+ None matching fails; there is no provider fallback.
28
29
  Models with API pi-virtual cannot run as target children, even if scoped. Check the supplied
29
30
  model API metadata; never pin a virtual model or inherit a pi-virtual parent. Ask for approval
30
31
  to choose a physical scoped model instead, otherwise skip the definition. Do not silently
@@ -431,7 +431,7 @@ export class OrderedModelEditorComponent extends Container {
431
431
 
432
432
  private withScopeWarning(text: string): string {
433
433
  if (this.scopedIdentities.size === 0) {
434
- return `No scoped models: Pick First (scoped) cannot run explicit preferences. Configure /scoped-models or change Model Picking. ${text}`;
434
+ return `No scope restriction: Pick First (scoped) uses all available models. ${text}`;
435
435
  }
436
436
  return text;
437
437
  }
@@ -408,7 +408,7 @@ const MODEL_SELECTION_OPTIONS = [
408
408
  id: "pick-first-scoped",
409
409
  label: "Pick First (scoped)",
410
410
  value: "First available preference in the session scope",
411
- help: "Pick First (scoped):\nPick the first available model in the agent's models list that is also selected in the current session's /scoped-models.\nSkip unavailable models and providers without credentials.",
411
+ help: "Pick First (scoped):\nPick the first available model in the agent's models list that is also selected in the current session's /scoped-models. An empty scope allows all available models.\nSkip unavailable models and providers without credentials.",
412
412
  },
413
413
  {
414
414
  id: "use-current",
@@ -419,7 +419,7 @@ const MODEL_SELECTION_OPTIONS = [
419
419
  ] as const;
420
420
 
421
421
  const MODEL_SELECTION_HELP =
422
- "Pick First (available): first preference with an enabled, authenticated provider in Pi.\nPick First (scoped): same, limited to the current session's /scoped-models.\nUse Current: ignore models and use the main session's current model; keep the agent's thinking level.\nOnly the models list affects runtime picking; modelSuggestions are search hints.\nSave and apply to affect agents when their sessions start.";
422
+ "Pick First (available): first preference with an enabled, authenticated provider in Pi.\nPick First (scoped): same, limited to the current session's /scoped-models when non-empty.\nUse Current: ignore models and use the main session's current model; keep the agent's thinking level.\nOnly the models list affects runtime picking; modelSuggestions are search hints.\nSave and apply to affect agents when their sessions start.";
423
423
 
424
424
  export async function configureAgents(
425
425
  ctx: ExtensionCommandContext,