@ferris1225/pi-subagents 4.3.22 → 4.3.23

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
@@ -3,6 +3,14 @@
3
3
  Release notes for `@ferris1225/pi-subagents`. Only the most recent releases
4
4
  are kept here; every published version is preserved as a GitHub Release.
5
5
 
6
+ ## 4.3.23
7
+
8
+ - Track Pi 1.0.3. The extension API, RPC command types, and the child
9
+ `registerProvider` path are unchanged. Pi renamed the Azure provider from
10
+ `azure-openai-responses` to `azure`; a stored agent model override follows
11
+ whichever of those ids the live catalog still lists, and is rewritten to
12
+ `azure/<id>` once that is the one Pi reports.
13
+
6
14
  ## 4.3.22
7
15
 
8
16
  - Use a subagent when the work can run independently in parallel, its boundary
package/README.md CHANGED
@@ -13,6 +13,11 @@ is clear, and delegation will actually reduce cost or improve completion quality
13
13
 
14
14
  ## What's new
15
15
 
16
+ **4.3.23** — Pi 1.0.3. Development dependencies track that release. A stored
17
+ agent model that still names `azure-openai-responses/<id>` keeps working: it
18
+ follows the live catalog, and is saved as `azure/<id>` once that is the id Pi
19
+ reports.
20
+
16
21
  **4.3.22** — use a subagent when the work can run independently in parallel, its
17
22
  boundary is clear, and delegation will actually reduce cost or improve
18
23
  completion quality. Role choice stays with scout and artisan.
@@ -155,7 +160,7 @@ material assumptions or blockers.
155
160
 
156
161
  Children run the official `pi --mode rpc` server, using Pi's exported command/response
157
162
  types and its own session persistence. There is no separate subagent protocol. The
158
- host transport remains local. Pi 1.0.2's `RpcClient` still spawns its own `node`
163
+ host transport remains local. Pi 1.0.3's `RpcClient` still spawns its own `node`
159
164
  process, signals only that process, and does not provide process-tree shutdown,
160
165
  bounded abort coordination, or cancellation of child extension dialogs.
161
166
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferris1225/pi-subagents",
3
- "version": "4.3.22",
3
+ "version": "4.3.23",
4
4
  "description": "A managed sub-agent team for pi: lightweight scout research and artisan implementation, one-shot runs, read-only status, and Git worktree isolation.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,11 +49,11 @@
49
49
  "typebox": "*"
50
50
  },
51
51
  "devDependencies": {
52
- "@earendil-works/pi-agent-core": "^1.0.2",
53
- "@earendil-works/pi-ai": "^1.0.2",
54
- "@earendil-works/pi-coding-agent": "^1.0.2",
55
- "@earendil-works/pi-server": "^1.0.2",
56
- "@earendil-works/pi-tui": "^1.0.2",
52
+ "@earendil-works/pi-agent-core": "^1.0.3",
53
+ "@earendil-works/pi-ai": "^1.0.3",
54
+ "@earendil-works/pi-coding-agent": "^1.0.3",
55
+ "@earendil-works/pi-server": "^1.0.3",
56
+ "@earendil-works/pi-tui": "^1.0.3",
57
57
  "@types/node": "^22.10.0",
58
58
  "typebox": "^1.3.27",
59
59
  "typescript": "^5.9.0"
@@ -54,6 +54,32 @@ function cleanModelRef(ref: string | undefined): string | undefined {
54
54
  return trimmed || undefined;
55
55
  }
56
56
 
57
+ /**
58
+ * Provider ids Pi renamed while keeping the model id. Pi 1.0.3 renamed
59
+ * `azure-openai-responses` to `azure`. The old id stays valid on earlier 1.0
60
+ * hosts, so a stored override follows whichever id the live catalog still has.
61
+ */
62
+ const RENAMED_PROVIDER_IDS: Readonly<Record<string, string>> = {
63
+ "azure-openai-responses": "azure",
64
+ };
65
+
66
+ /** Stored ref plus the renamed provider id, when Pi published one. */
67
+ export function modelRefAliases(ref: string): readonly string[] {
68
+ const normalized = ref.trim();
69
+ const slash = normalized.indexOf("/");
70
+ if (slash <= 0 || slash >= normalized.length - 1) return [normalized];
71
+ const renamed = RENAMED_PROVIDER_IDS[normalized.slice(0, slash)];
72
+ if (!renamed) return [normalized];
73
+ return [normalized, `${renamed}${normalized.slice(slash)}`];
74
+ }
75
+
76
+ /** Prefer the alias that the live catalog actually lists. */
77
+ function resolveLiveModelRef(ref: string, liveRefs: ReadonlySet<string> | undefined): string | undefined {
78
+ const aliases = modelRefAliases(ref);
79
+ if (!liveRefs) return aliases[0];
80
+ return aliases.find((candidate) => liveRefs.has(candidate));
81
+ }
82
+
57
83
  export function modelRef(model: { provider: string; id: string }): string {
58
84
  return `${model.provider}/${model.id}`;
59
85
  }
@@ -82,7 +108,9 @@ export function findModelByRef(
82
108
  ref: string | undefined,
83
109
  ): Model<Api> | undefined {
84
110
  const normalized = cleanModelRef(ref);
85
- return normalized ? models.find((model) => modelRef(model) === normalized) : undefined;
111
+ if (!normalized) return undefined;
112
+ const aliases = new Set(modelRefAliases(normalized));
113
+ return models.find((model) => aliases.has(modelRef(model)));
86
114
  }
87
115
 
88
116
  /** Split persisted agent model overrides into the ones Pi still reports as
@@ -95,7 +123,10 @@ export function filterUnavailableModelOverrides(
95
123
  const kept: Record<string, string> = {};
96
124
  const dropped: Array<{ agent: string; ref: string }> = [];
97
125
  for (const [agent, ref] of Object.entries(agentModels)) {
98
- if (findModelByRef(models, ref)) kept[agent] = ref;
126
+ const model = findModelByRef(models, ref);
127
+ // Persist the id the live catalog uses, so a renamed provider does not
128
+ // stay stored under the id Pi no longer registers.
129
+ if (model) kept[agent] = modelRef(model);
99
130
  else dropped.push({ agent, ref });
100
131
  }
101
132
  return { kept, dropped };
@@ -116,8 +147,9 @@ export function resolveAgentModelRoute(input: AgentModelRouteInput): ResolvedAge
116
147
  const available = input.availableRefs
117
148
  ? new Set(input.availableRefs.map((ref) => ref.trim()).filter(Boolean))
118
149
  : undefined;
119
- const selectedAvailable = !selectedRef || !available || available.has(selectedRef);
120
- const usableSelectedRef = selectedAvailable ? selectedRef : undefined;
150
+ const resolvedSelectedRef = selectedRef ? resolveLiveModelRef(selectedRef, available) : undefined;
151
+ const selectedAvailable = !selectedRef || resolvedSelectedRef !== undefined;
152
+ const usableSelectedRef = selectedAvailable ? resolvedSelectedRef : undefined;
121
153
  const primaryRef = usableSelectedRef ?? mainRef;
122
154
  const ordered = [primaryRef, usableSelectedRef && usableSelectedRef !== mainRef ? mainRef : undefined];
123
155
  const candidateRefs = [...new Set(ordered.filter((ref): ref is string => Boolean(ref)))];
@@ -155,18 +187,21 @@ export function buildModelPickerItems(options: {
155
187
  configuredRef?: string;
156
188
  mainRef?: string;
157
189
  }): ModelPickerItem[] {
158
- const configuredRef = cleanModelRef(options.configuredRef);
159
190
  const mainRef = cleanModelRef(options.mainRef);
160
191
  const byRef = new Map<string, ModelListEntry>();
161
192
  for (const model of options.models) {
162
193
  const ref = modelRef(model);
163
194
  if (!byRef.has(ref)) byRef.set(ref, model);
164
195
  }
196
+ const configuredRef = cleanModelRef(options.configuredRef);
197
+ const liveConfiguredRef = configuredRef
198
+ ? resolveLiveModelRef(configuredRef, new Set(byRef.keys())) ?? configuredRef
199
+ : undefined;
165
200
 
166
201
  const refs = [...byRef.keys()]
167
202
  .sort((left, right) => {
168
- const leftRank = left === configuredRef ? 0 : left === mainRef ? 1 : 2;
169
- const rightRank = right === configuredRef ? 0 : right === mainRef ? 1 : 2;
203
+ const leftRank = left === liveConfiguredRef ? 0 : left === mainRef ? 1 : 2;
204
+ const rightRank = right === liveConfiguredRef ? 0 : right === mainRef ? 1 : 2;
170
205
  return leftRank - rightRank || left.localeCompare(right);
171
206
  });
172
207
 
@@ -178,7 +213,7 @@ export function buildModelPickerItems(options: {
178
213
  const items: ModelPickerItem[] = [dynamic];
179
214
  for (const ref of refs) {
180
215
  const model = byRef.get(ref)!;
181
- const tags = [ref === configuredRef ? "configured" : "", ref === mainRef ? "current main" : ""]
216
+ const tags = [ref === liveConfiguredRef ? "configured" : "", ref === mainRef ? "current main" : ""]
182
217
  .filter(Boolean);
183
218
  const name = model.name.trim() && model.name !== model.id ? model.name.trim() : undefined;
184
219
  items.push({
@@ -20,8 +20,10 @@ async function removeUnavailableAgentModels(
20
20
  const overrides = Object.entries(config.agentModels);
21
21
  if (overrides.length === 0) return;
22
22
  const { kept, dropped } = filterUnavailableModelOverrides(config.agentModels, availableModelsInScope(ctx));
23
- if (dropped.length === 0) return;
23
+ const rewritten = JSON.stringify(kept) !== JSON.stringify(config.agentModels);
24
+ if (!rewritten && dropped.length === 0) return;
24
25
  await saveConfig({ ...config, agentModels: kept }, runtime.configPath);
26
+ if (dropped.length === 0) return;
25
27
  const list = dropped.map(({ agent, ref }) => `${agent}: ${ref}`).join(", ");
26
28
  ctx.ui.notify(
27
29
  `pi-subagents: removed stale agent model overrides that are no longer available (${list}). Those agents now use their role's default model route; run /subagents-setup to re-pick.`,