@aiwayds/dsh-model-sync 0.11.0 → 0.12.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.
@@ -7,83 +7,35 @@
7
7
  // here is a pure function of its inputs so it can be exercised with offline
8
8
  // fixtures only.
9
9
  //
10
- // Design refs: §2.1/§6.2.2 (route fields + msg baseURL normalization),
11
- // §6.2.3 (grouping), §6.2.4 (ownership-aware merge), §6.2.5 (route fields),
12
- // §9.2-9.4 (keep the name, conflicts, empty routes), ADR-004 (ledger keyed
13
- // by keyFingerprint), ADR-005 (deletion gates). F25 is intentionally absent:
14
- // report 19 proved the host injects x-opencode-session, so no special header
15
- // handling belongs in the plan.
10
+ // 0.12.0 single-route (catalog-reuse) shape: the host only reuses pi-ai's
11
+ // builtin catalog provider when a route carries no `api` field, and pi-ai
12
+ // 1.6.0's opencode-go catalog gives every model its own per-protocol baseUrl —
13
+ // so a managed route must never carry `api`/`baseURL`. The plan therefore
14
+ // writes ONE route (the `chat` slot route) holding ALL official entries, and
15
+ // plans cleanup for the three legacy protocol routes: unset when fully
16
+ // plugin-managed, keep+warn when they hold user content. Report 19's per-slot
17
+ // api/baseURL tables are gone with the topology they described.
16
18
  import { createHash } from 'node:crypto';
17
19
  import { deriveKeyRef } from "./route-credential.js";
18
- import { GO_SLOT_ROUTES, groupGoModelsByProtocol, } from "./opencode-go-grouping.js";
19
- // ---------------------------------------------------------------------------
20
- // Static route-field plan (design §2.1 / §6.2.2, confirmed by report 19)
21
- // ---------------------------------------------------------------------------
22
- /** Host `api` value per slot (llm-pi-ai PROTOCOLS, report 19 §1). */
23
- export const GO_API_BY_SLOT = {
24
- chat: 'openai-completions',
25
- msg: 'anthropic-messages',
26
- resp: 'openai-responses',
27
- google: 'google-generative-ai',
28
- };
29
- /** The only display field the host uses to group providers (F22/13). */
30
- export const GO_DISPLAY_NAME_BY_SLOT = {
31
- chat: 'OpenCode Go',
32
- msg: 'OpenCode Go · msg',
33
- resp: 'OpenCode Go · resp',
34
- google: 'OpenCode Go · google',
35
- };
20
+ import { GO_SLOT_ROUTES, } from "./opencode-go-grouping.js";
21
+ /** The display name planned for the single managed route (F22/13). */
22
+ export const GO_DISPLAY_NAME = 'OpenCode Go';
36
23
  /**
37
- * Fallback host baseURLs — the values report 19 confirmed end-to-end. Normally
38
- * the baseURL comes from the official payload (§6.2.2); these are used only
39
- * when a record carries no per-protocol `base_url`.
24
+ * Legacy route fields the writer must strip from the managed route (and that
25
+ * old 0.11.x routes carry). They are never part of a written plan.
40
26
  */
41
- export const GO_BASE_URL_BY_SLOT = {
42
- chat: 'https://opencode.ai/inference/go/openai/v1',
43
- msg: 'https://opencode.ai/inference/go/anthropic',
44
- resp: 'https://opencode.ai/inference/go/openai/v1',
45
- google: 'https://opencode.ai/inference/go/google/v1beta',
46
- };
47
- /** Official protocol keys that back each slot (§6.2.2 table). */
48
- export const GO_PROTOCOLS_BY_SLOT = {
49
- chat: ['chat-completions'],
50
- msg: ['messages'],
51
- resp: ['responses'],
52
- google: ['interactions', 'generate-content'],
53
- };
27
+ export const GO_LEGACY_ROUTE_FIELDS = ['api', 'baseURL'];
54
28
  /**
55
- * Normalize an official `base_url` for host use. Only `msg` changes: pi-ai
56
- * calls `beta.messages.create` and appends `/v1/messages?beta=true`, so the
57
- * trailing `/v1` must be stripped (ADR-003 / report 19 negative control).
58
- */
59
- export function normalizeGoBaseUrl(raw, slot) {
60
- const trimmed = raw.replace(/\/+$/, '');
61
- if (slot === 'msg' && trimmed.endsWith('/v1'))
62
- return trimmed.slice(0, -3);
63
- return trimmed;
64
- }
65
- /**
66
- * Build the route fields for a slot from the payload's per-protocol base_url.
29
+ * Build the planned route fields for the single managed route. `entries` is
30
+ * kept in the signature for symmetry with the migration caller (and future
31
+ * payload-driven fields); with the catalog-reuse shape the fields no longer
32
+ * depend on the payload — the endpoint lives in pi-ai's builtin catalog.
67
33
  * `ref` defaults to the P0-derived `OPENCODE_GO_API_KEY`.
68
34
  */
69
- export function planGoRouteFields(slot, entries, ref = deriveKeyRef('opencode-go')) {
70
- const protocols = GO_PROTOCOLS_BY_SLOT[slot];
71
- let raw;
72
- for (const entry of entries) {
73
- for (const protocol of protocols) {
74
- const base = entry.baseUrls[protocol];
75
- if (base !== undefined && base.length > 0) {
76
- raw = base;
77
- break;
78
- }
79
- }
80
- if (raw !== undefined)
81
- break;
82
- }
35
+ export function planGoRouteFields(entries, ref = deriveKeyRef('opencode-go')) {
36
+ void entries;
83
37
  return {
84
- api: GO_API_BY_SLOT[slot],
85
- baseURL: raw !== undefined ? normalizeGoBaseUrl(raw, slot) : GO_BASE_URL_BY_SLOT[slot],
86
- displayName: GO_DISPLAY_NAME_BY_SLOT[slot],
38
+ displayName: GO_DISPLAY_NAME,
87
39
  apiKeyEnv: ref,
88
40
  };
89
41
  }
@@ -136,7 +88,7 @@ function canonicalize(value) {
136
88
  export function profileHash(profile) {
137
89
  return createHash('sha256').update(JSON.stringify(canonicalize(profile))).digest('hex');
138
90
  }
139
- const OWNERSHIP_FIELDS = ['api', 'baseURL', 'apiKeyEnv'];
91
+ const OWNERSHIP_FIELDS = ['apiKeyEnv'];
140
92
  /** A current route conflicts only when a field is explicitly set to a different value. */
141
93
  function detectConflict(slot, route, fields, current) {
142
94
  if (current === undefined || !current.exists)
@@ -167,172 +119,186 @@ function ownedFieldsMatch(owned, fields) {
167
119
  /**
168
120
  * Build the write plan. Pure: identical inputs always produce an identical
169
121
  * plan (report/order included). No mutation of `options` or its nested values.
122
+ *
123
+ * Topology (0.12.0): ONE managed route (the `chat` slot route) receives ALL
124
+ * official entries; the three legacy protocol routes (msg/resp/google) are
125
+ * cleanup targets — unset when fully plugin-managed, kept with a warn when
126
+ * they hold user content.
170
127
  */
171
128
  export function planGoRoutes(options) {
172
129
  const ref = options.ref ?? deriveKeyRef('opencode-go');
173
130
  const routes = { ...GO_SLOT_ROUTES, ...(options.routes ?? {}) };
174
131
  const pinned = new Set(options.pinnedModels ?? []);
175
- const grouping = groupGoModelsByProtocol(options.entries);
176
132
  const report = [];
177
133
  const conflicts = [];
178
134
  const plannedRoutes = [];
179
135
  const unsetRoutes = [];
180
136
  const nextOwnership = { ...options.ownership };
181
137
  const desiredByRoute = {};
182
- // Unknown / otherwise unsupported protocols are fail-closed: reported, never
183
- // written (design §6.2.3, V1).
184
- for (const unassigned of grouping.unassigned) {
185
- report.push({
186
- level: 'warn',
187
- code: unassigned.reason,
188
- id: unassigned.id,
189
- message: `model ${unassigned.id} not assigned (${unassigned.protocols.join(',') || 'no protocols'})`,
190
- });
191
- }
192
138
  const entryById = new Map(options.entries.map((entry) => [entry.id, entry]));
193
- for (const slot of ['chat', 'msg', 'resp', 'google']) {
194
- const desiredIds = grouping.slots[slot] ?? [];
195
- const route = routes[slot];
196
- const current = options.currentRoutes[route];
197
- const ledgerKey = goOwnershipKey(route, options.keyFingerprint);
198
- const owned = options.ownership[ledgerKey];
199
- desiredByRoute[route] = [];
200
- // Google slot is conditional and default-off (design §2.1): materialize it
201
- // only when it has members, or when there is a previous ledger to clean up.
202
- if (slot === 'google' && desiredIds.length === 0 && owned === undefined)
203
- continue;
204
- const slotEntries = desiredIds
205
- .map((id) => entryById.get(id))
206
- .filter((entry) => entry !== undefined);
207
- const fields = planGoRouteFields(slot, slotEntries, ref);
208
- // Empty group: never produce a `models: []` write (§9.4 / A9). Unset a
209
- // fully plugin-managed route, otherwise skip (keeping the route as-is) and
210
- // report. A slot with no route at all is not planned at all.
211
- if (desiredIds.length === 0) {
212
- const currentModels = current?.models ?? [];
213
- if (current === undefined || !current.exists)
214
- continue;
215
- if (slot === 'chat') {
216
- // §9.4: an empty main route after a 200 is an upstream anomaly — keep
217
- // last-good, write nothing.
218
- plannedRoutes.push({ slot, route, fields, models: [...currentModels], unset: false, skip: true });
219
- report.push({ level: 'warn', code: 'upstream-empty', route, slot, message: 'main route has no members; kept last-good, no write' });
220
- continue;
221
- }
222
- const managed = owned?.managed ?? {};
223
- const fullyManaged = owned !== undefined
224
- && currentModels.length > 0
225
- && currentModels.every((model) => {
226
- const record = managed[model.id];
227
- return record !== undefined && record.hash === profileHash(model);
228
- })
229
- && ownedFieldsMatch(owned, fields);
230
- if (fullyManaged) {
231
- plannedRoutes.push({ slot, route, fields, models: [], unset: true, skip: false });
232
- unsetRoutes.push(route);
233
- report.push({ level: 'info', code: 'unset-route', route, slot, message: `route ${route} is empty and fully plugin-managed; unset` });
234
- delete nextOwnership[ledgerKey];
235
- }
236
- else {
237
- plannedRoutes.push({ slot, route, fields, models: [...currentModels], unset: false, skip: true });
238
- if (currentModels.length > 0) {
239
- report.push({ level: 'warn', code: 'route-empty-has-user-content', route, slot, message: `route ${route} is empty but has user content; kept, no empty write` });
240
- }
241
- }
242
- continue;
139
+ // Single-route desired set: every official entry, in stable id order.
140
+ const desiredIds = [...entryById.keys()].sort((a, b) => a.localeCompare(b));
141
+ // --- The single managed route (chat slot) --------------------------------
142
+ const managedSlot = 'chat';
143
+ const managedRoute = routes[managedSlot];
144
+ const current = options.currentRoutes[managedRoute];
145
+ const ledgerKey = goOwnershipKey(managedRoute, options.keyFingerprint);
146
+ const owned = options.ownership[ledgerKey];
147
+ const fields = planGoRouteFields(options.entries, ref);
148
+ desiredByRoute[managedRoute] = [];
149
+ if (desiredIds.length === 0) {
150
+ const currentModels = current?.models ?? [];
151
+ if (current !== undefined && current.exists) {
152
+ // §9.4: an empty main route after a 200 is an upstream anomaly — keep
153
+ // last-good, write nothing.
154
+ plannedRoutes.push({ slot: managedSlot, route: managedRoute, fields, models: [...currentModels], unset: false, skip: true });
155
+ report.push({ level: 'warn', code: 'upstream-empty', route: managedRoute, slot: managedSlot, message: 'main route has no members; kept last-good, no write' });
243
156
  }
244
- const conflict = detectConflict(slot, route, fields, current);
157
+ }
158
+ else {
159
+ const conflict = detectConflict(managedSlot, managedRoute, fields, current);
245
160
  if (conflict !== undefined) {
246
161
  conflicts.push(conflict);
247
162
  report.push({
248
163
  level: 'error',
249
164
  code: 'route-conflict',
250
- route,
251
- slot,
252
- message: `${route}.${conflict.field} is ${conflict.actual}, expected ${conflict.expected}`,
165
+ route: managedRoute,
166
+ slot: managedSlot,
167
+ message: `${managedRoute}.${conflict.field} is ${conflict.actual}, expected ${conflict.expected}`,
253
168
  });
254
- continue;
255
169
  }
256
- const desiredById = new Map();
257
- for (const id of desiredIds) {
258
- const entry = entryById.get(id);
259
- if (entry !== undefined)
260
- desiredById.set(id, mapGoModelToProfile(entry));
261
- }
262
- desiredByRoute[route] = [...desiredById.values()];
263
- const currentModels = current?.models ?? [];
264
- const managed = owned?.managed ?? {};
265
- const nextManaged = {};
266
- const kept = [];
267
- for (const model of currentModels) {
268
- const id = model.id;
269
- const desired = desiredById.get(id);
270
- const record = managed[id];
271
- const hashMatches = record !== undefined && record.hash === profileHash(model);
272
- const hasOverride = (current?.overrideIds ?? []).includes(id);
273
- const isPinned = pinned.has(id);
274
- if (desired !== undefined) {
275
- if (record !== undefined && hashMatches) {
276
- // Plugin-owned and untouched: overwrite with the freshly mapped value.
277
- const next = desired;
278
- nextManaged[id] = { hash: profileHash(next) };
279
- kept.push(next);
280
- report.push({ level: 'info', code: 'overwrote-managed', route, slot, id, message: `refreshed plugin-managed model ${id}` });
170
+ else {
171
+ const desiredById = new Map();
172
+ for (const id of desiredIds) {
173
+ const entry = entryById.get(id);
174
+ if (entry !== undefined)
175
+ desiredById.set(id, mapGoModelToProfile(entry));
176
+ }
177
+ desiredByRoute[managedRoute] = [...desiredById.values()];
178
+ // Catalog-reuse strip notice: a route still carrying the old 0.11.x
179
+ // `api`/`baseURL` fields gets them unset this round (the writer emits
180
+ // the ops; this line explains why in the report).
181
+ if (current !== undefined && current.exists
182
+ && GO_LEGACY_ROUTE_FIELDS.some((field) => current[field] !== undefined && current[field] !== '')) {
183
+ report.push({
184
+ level: 'info',
185
+ code: 'legacy-fields-strip',
186
+ route: managedRoute,
187
+ slot: managedSlot,
188
+ message: `route ${managedRoute} carries legacy api/baseURL fields; unsetting them so the host reuses the pi-ai builtin catalog provider (catalog-reuse fix)`,
189
+ });
190
+ }
191
+ const currentModels = current?.models ?? [];
192
+ const managed = owned?.managed ?? {};
193
+ const nextManaged = {};
194
+ const kept = [];
195
+ for (const model of currentModels) {
196
+ const id = model.id;
197
+ const desired = desiredById.get(id);
198
+ const record = managed[id];
199
+ const hashMatches = record !== undefined && record.hash === profileHash(model);
200
+ const hasOverride = (current?.overrideIds ?? []).includes(id);
201
+ const isPinned = pinned.has(id);
202
+ if (desired !== undefined) {
203
+ if (record !== undefined && hashMatches) {
204
+ // Plugin-owned and untouched: overwrite with the freshly mapped value.
205
+ const next = desired;
206
+ nextManaged[id] = { hash: profileHash(next) };
207
+ kept.push(next);
208
+ report.push({ level: 'info', code: 'overwrote-managed', route: managedRoute, slot: managedSlot, id, message: `refreshed plugin-managed model ${id}` });
209
+ }
210
+ else {
211
+ // Not in ledger, or hash differs (user edited): keep as-is, never claim.
212
+ kept.push(model);
213
+ if (record !== undefined)
214
+ nextManaged[id] = record;
215
+ report.push({
216
+ level: 'info',
217
+ code: 'kept-user-owned',
218
+ route: managedRoute,
219
+ slot: managedSlot,
220
+ id,
221
+ message: record !== undefined ? `model ${id} was modified; kept user value` : `model ${id} is user-owned; kept`,
222
+ });
223
+ }
224
+ continue;
281
225
  }
282
- else {
283
- // Not in ledger, or hash differs (user edited): keep as-is, never claim.
284
- kept.push(model);
285
- if (record !== undefined)
286
- nextManaged[id] = record;
287
- report.push({
288
- level: 'info',
289
- code: 'kept-user-owned',
290
- route,
291
- slot,
292
- id,
293
- message: record !== undefined ? `model ${id} was modified; kept user value` : `model ${id} is user-owned; kept`,
294
- });
226
+ // Not desired: the three deletion gates (ADR-005 / §6.2.4).
227
+ if (record !== undefined && hashMatches && !hasOverride && !isPinned) {
228
+ report.push({ level: 'info', code: 'deletion-candidate', route: managedRoute, slot: managedSlot, id, message: `model ${id} passed all three deletion gates` });
229
+ continue;
295
230
  }
296
- continue;
231
+ kept.push(model);
232
+ if (record !== undefined)
233
+ nextManaged[id] = record;
234
+ const code = record === undefined
235
+ ? 'kept-user-owned'
236
+ : !hashMatches
237
+ ? 'kept-modified'
238
+ : hasOverride
239
+ ? 'kept-override'
240
+ : 'kept-pinned';
241
+ report.push({ level: 'info', code, route: managedRoute, slot: managedSlot, id, message: `model ${id} kept (${code}); not removed` });
297
242
  }
298
- // Not desired: the three deletion gates (ADR-005 / §6.2.4).
299
- if (record !== undefined && hashMatches && !hasOverride && !isPinned) {
300
- report.push({ level: 'info', code: 'deletion-candidate', route, slot, id, message: `model ${id} passed all three deletion gates` });
301
- continue;
243
+ // New desired ids (absent from settings) are added and claimed.
244
+ const currentIds = new Set(currentModels.map((model) => model.id));
245
+ for (const id of desiredIds) {
246
+ if (currentIds.has(id))
247
+ continue;
248
+ const profile = desiredById.get(id);
249
+ if (profile === undefined)
250
+ continue;
251
+ nextManaged[id] = { hash: profileHash(profile) };
252
+ kept.push(profile);
253
+ report.push({ level: 'info', code: 'added', route: managedRoute, slot: managedSlot, id, message: `added model ${id}` });
302
254
  }
303
- kept.push(model);
304
- if (record !== undefined)
305
- nextManaged[id] = record;
306
- const code = record === undefined
307
- ? 'kept-user-owned'
308
- : !hashMatches
309
- ? 'kept-modified'
310
- : hasOverride
311
- ? 'kept-override'
312
- : 'kept-pinned';
313
- report.push({ level: 'info', code, route, slot, id, message: `model ${id} kept (${code}); not removed` });
255
+ // `desiredIds` is non-empty here, so the merged array is never empty.
256
+ const merged = [...kept].sort((a, b) => a.id.localeCompare(b.id));
257
+ plannedRoutes.push({ slot: managedSlot, route: managedRoute, fields, models: merged, unset: false, skip: false });
258
+ // P1d-2 ownership: inherit the prior entry so migration-period fields
259
+ // (`preManagedSection` / `appliedAddedIds` and any future ones) survive the
260
+ // plan round-trip untouched. The planner never writes or clears these — it
261
+ // only refreshes the fields it owns (routeFields / managed). The go writer
262
+ // applies the same merge when it persists the ledger entry.
263
+ nextOwnership[ledgerKey] = { ...owned, routeFields: fields, managed: nextManaged };
314
264
  }
315
- // New desired ids (absent from settings) are added and claimed.
316
- const currentIds = new Set(currentModels.map((model) => model.id));
317
- for (const id of desiredIds) {
318
- if (currentIds.has(id))
319
- continue;
320
- const profile = desiredById.get(id);
321
- if (profile === undefined)
265
+ }
266
+ // --- Legacy protocol routes: cleanup plan ---------------------------------
267
+ // Only on a healthy payload: an anomalous empty listing must not trigger
268
+ // route teardown on top of the upstream anomaly.
269
+ if (desiredIds.length > 0) {
270
+ for (const slot of ['msg', 'resp', 'google']) {
271
+ const route = routes[slot];
272
+ const routeCurrent = options.currentRoutes[route];
273
+ const legacyLedgerKey = goOwnershipKey(route, options.keyFingerprint);
274
+ const legacyOwned = options.ownership[legacyLedgerKey];
275
+ if ((routeCurrent === undefined || !routeCurrent.exists) && legacyOwned === undefined)
322
276
  continue;
323
- nextManaged[id] = { hash: profileHash(profile) };
324
- kept.push(profile);
325
- report.push({ level: 'info', code: 'added', route, slot, id, message: `added model ${id}` });
277
+ const legacyFields = planGoRouteFields(options.entries, ref);
278
+ const currentModels = routeCurrent?.models ?? [];
279
+ const managed = legacyOwned?.managed ?? {};
280
+ // Fully managed = the plugin owns every model present (an empty route
281
+ // with a ledger entry counts: it was emptied by a previous round) and
282
+ // the recorded ownership fields match this plan.
283
+ const fullyManaged = legacyOwned !== undefined
284
+ && currentModels.every((model) => {
285
+ const record = managed[model.id];
286
+ return record !== undefined && record.hash === profileHash(model);
287
+ })
288
+ && ownedFieldsMatch(legacyOwned, legacyFields);
289
+ if (fullyManaged) {
290
+ plannedRoutes.push({ slot, route, fields: legacyFields, models: [], unset: true, skip: false });
291
+ unsetRoutes.push(route);
292
+ report.push({ level: 'info', code: 'unset-legacy-route', route, slot, message: `legacy route ${route} is superseded by the single managed route and fully plugin-managed; unset` });
293
+ delete nextOwnership[legacyLedgerKey];
294
+ }
295
+ else {
296
+ plannedRoutes.push({ slot, route, fields: legacyFields, models: [...currentModels], unset: false, skip: true });
297
+ if (currentModels.length > 0) {
298
+ report.push({ level: 'warn', code: 'legacy-route-kept', route, slot, message: `legacy route ${route} holds user content; kept as-is (superseded by the single managed route)` });
299
+ }
300
+ }
326
301
  }
327
- // `desiredIds` is non-empty here, so the merged array is never empty.
328
- const merged = [...kept].sort((a, b) => a.id.localeCompare(b.id));
329
- plannedRoutes.push({ slot, route, fields, models: merged, unset: false, skip: false });
330
- // P1d-2 ownership: inherit the prior entry so migration-period fields
331
- // (`preManagedSection` / `appliedAddedIds` and any future ones) survive the
332
- // plan round-trip untouched. The planner never writes or clears these — it
333
- // only refreshes the fields it owns (routeFields / managed). The go writer
334
- // applies the same merge when it persists the ledger entry.
335
- nextOwnership[ledgerKey] = { ...owned, routeFields: fields, managed: nextManaged };
336
302
  }
337
303
  return { routes: plannedRoutes, unsetRoutes, conflicts, report, nextOwnership, desiredByRoute };
338
304
  }
@@ -1 +1 @@
1
- {"version":3,"file":"opencode-go-planner.js","sourceRoot":"","sources":["../src/opencode-go-planner.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wDAAwD;AACxD,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,iBAAiB;AACjB,EAAE;AACF,uEAAuE;AACvE,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,gCAAgC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACL,cAAc,EACd,uBAAuB,GAExB,MAAM,2BAA2B,CAAA;AAElC,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAE9E,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAA0C;IACnE,IAAI,EAAE,oBAAoB;IAC1B,GAAG,EAAE,oBAAoB;IACzB,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,sBAAsB;CAC/B,CAAA;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,uBAAuB,GAA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AAI,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;gBAC/F,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;gBACvB,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,KAAK,4EAA4E,EAAE,CAAC,CAAA;gBACnL,OAAO,aAAa,CAAC,eAAe,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;gBAC/G,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC7B,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,KAAK,0EAA0E,EAAE,CAAC,CAAA;gBAClL,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,CAAA;AACjG,CAAC"}
@@ -14,16 +14,17 @@
14
14
  // merge, double confirmation), §6.2.5 (route-field ownership), §9.1 (one
15
15
  // mutate per route), §9.4 (empty route → unset, never `models: []`),
16
16
  // ADR-004, V5/V9/V13. Rollback lives in opencode-go-migrate.ts.
17
- import { goOwnershipKey, profileHash, } from "./opencode-go-planner.js";
17
+ import { goOwnershipKey, profileHash, GO_LEGACY_ROUTE_FIELDS, } from "./opencode-go-planner.js";
18
18
  import { profilesEqual, } from "./writer.js";
19
19
  import { goJournalKey, journalContentHash, } from "./opencode-go-journal.js";
20
20
  import { fingerprintSection } from "./opencode-go-migration.js";
21
21
  const SETTINGS_CONFLICT = 'SETTINGS_CONFLICT';
22
- // O1-minimal: `displayName` is a display field, NOT an identity/ownership field.
23
- // It is deliberately kept out of this set so it matches the planner's
24
- // OWNERSHIP_FIELDS (detectConflict), which never checks it. A display-name-only
25
- // upstream change must not make the writer rewrite the route's identity fields.
26
- const OWNED_FIELDS = ['api', 'baseURL', 'apiKeyEnv'];
22
+ // 0.12.0 catalog-reuse: the ONLY route field the writer sets is `apiKeyEnv`.
23
+ // `api`/`baseURL` must stay UNSET (they make the host build the provider from
24
+ // the bare PROTOCOLS implementation — missing `x-opencode-session` → HTTP 400
25
+ // — instead of pi-ai's builtin catalog provider), and `displayName` is a
26
+ // display field deliberately never rewritten so a user rename survives.
27
+ const OWNED_FIELDS = ['apiKeyEnv'];
27
28
  // O1-minimal: a settings.mutate can land while the ledger/record write after it
28
29
  // fails. That route is NOT a clean success (no ledger => next round keeps it as
29
30
  // user-owned) and NOT a lock-only failure either (retrying does nothing). Report
@@ -336,10 +337,11 @@ function abandonForSettingsChange(result, report, plan, expectedRevision, actual
336
337
  return result;
337
338
  }
338
339
  /**
339
- * Build one route's ops. `set api/baseURL/displayName/apiKeyEnv/models` (or a
340
- * whole-route `unset`) all go into ONE mutate, so a route never ends up with
341
- * fields from one round and models from another (§6.2.4 atomicity).
342
- * Returns `undefined` when nothing would change (`profilesEqual` gate).
340
+ * Build one route's ops. Set `apiKeyEnv` + unset any legacy `api`/`baseURL`
341
+ * (or a whole-route `unset`) + set `models`, all in ONE mutate, so a route
342
+ * never ends up with fields from one round and models from another
343
+ * (§6.2.4 atomicity). Returns `undefined` when nothing would change
344
+ * (`profilesEqual` gate).
343
345
  */
344
346
  async function buildRouteOps(planned, desc, finalModels, overrideStorer) {
345
347
  const data = rawRoute(desc, planned.route);
@@ -369,6 +371,15 @@ async function buildRouteOps(planned, desc, finalModels, overrideStorer) {
369
371
  ops.push({ op: 'set', path: ['providers', planned.route, field], value: planned.fields[field] });
370
372
  }
371
373
  }
374
+ // Catalog-reuse: a route still carrying the 0.11.x `api`/`baseURL` fields
375
+ // gets them unset — with any `api` present the host leaves pi-ai's builtin
376
+ // catalog provider (and its x-opencode-session wrapping) behind.
377
+ for (const field of GO_LEGACY_ROUTE_FIELDS) {
378
+ const value = data?.[field];
379
+ if (value !== undefined && value !== '') {
380
+ ops.push({ op: 'unset', path: ['providers', planned.route, field] });
381
+ }
382
+ }
372
383
  const currentRaw = sortedModels(rawModels(desc, planned.route));
373
384
  const mergedSorted = sortedModels(mergedModels);
374
385
  postWriteModels = mergedSorted;