@oh-my-pi/pi-catalog 16.1.0 → 16.1.2

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.
@@ -854,8 +854,20 @@ interface XAICuratedModel {
854
854
  // omit/include/history replay defaults live in catalog compat so every
855
855
  // OpenAI-family endpoint consumes the same constraint.
856
856
  export const XAI_OAUTH_CURATED_MODELS: readonly XAICuratedModel[] = [
857
- // grok-build is text-only per the bundled catalog; omit `input` for the default.
858
- { id: "grok-build", contextWindow: 512_000, name: "Grok Build", supportsReasoningEffort: false },
857
+ {
858
+ id: "grok-build",
859
+ contextWindow: 512_000,
860
+ name: "Grok Build",
861
+ supportsReasoningEffort: false,
862
+ input: ["text", "image"],
863
+ },
864
+ {
865
+ id: "grok-build-0.1",
866
+ contextWindow: 256_000,
867
+ name: "Grok Build 0.1",
868
+ supportsReasoningEffort: false,
869
+ input: ["text", "image"],
870
+ },
859
871
  { id: "grok-4.3", contextWindow: 1_000_000, name: "Grok 4.3", input: ["text", "image"] },
860
872
  // grok-4.20-multi-agent-0309 is text-only per the bundled catalog; omit `input` for the default.
861
873
  { id: "grok-4.20-multi-agent-0309", contextWindow: 2_000_000, name: "Grok 4.20 (Multi-Agent)" },
@@ -76,6 +76,13 @@ export interface EffortVariantFamily {
76
76
  thinking: Readonly<Omit<ThinkingConfig, "effortRouting" | "suppressWhenOff">>;
77
77
  /** Thinking-off requests must explicitly suppress thinking on the wire. */
78
78
  suppressWhenOff?: boolean;
79
+ /**
80
+ * Preserve non-off effort routes even when discovery omits the backing member.
81
+ * Used for Cloud Code Assist `X`/`X-thinking` pairs where upstream accepts
82
+ * the `-thinking` wire id but the model-list endpoint may advertise only the
83
+ * bare id.
84
+ */
85
+ preserveAbsentEffortRoutes?: boolean;
79
86
  /** Retired/recycled selector ids that alias to this family without being members. */
80
87
  extraAliases?: readonly string[];
81
88
  }
@@ -100,6 +107,7 @@ function thinkingPair(baseId: string, name: string): EffortVariantFamily {
100
107
  // Thinking-off routes to the non-thinking backing id, where omitting
101
108
  // thinkingConfig is already correct — no suppressWhenOff.
102
109
  thinking: { mode: "budget", efforts: [Effort.Minimal, Effort.Low, Effort.Medium, Effort.High] },
110
+ preserveAbsentEffortRoutes: true,
103
111
  };
104
112
  }
105
113
 
@@ -517,12 +525,18 @@ export function collapseEffortVariants<TSpec extends VariantSpecLike>(
517
525
  const routing: Partial<Record<Effort | "off", string>> = {};
518
526
  let hasRouting = false;
519
527
  let hasEffortRoute = false;
528
+ let usedAbsentEffortRoute = false;
520
529
  for (const effortKey in family.routing) {
521
530
  const target = family.routing[effortKey as Effort | "off"];
522
- if (target !== undefined && presentSet.has(target) && !retired?.has(target)) {
523
- routing[effortKey as Effort | "off"] = target;
531
+ const effort = effortKey as Effort | "off";
532
+ const targetPresent = target !== undefined && presentSet.has(target);
533
+ const preserveAbsentEffort =
534
+ target !== undefined && effort !== "off" && family.preserveAbsentEffortRoutes === true;
535
+ if (target !== undefined && (targetPresent || preserveAbsentEffort) && !retired?.has(target)) {
536
+ routing[effort] = target;
524
537
  hasRouting = true;
525
538
  if (effortKey !== "off") hasEffortRoute = true;
539
+ if (!targetPresent && effort !== "off") usedAbsentEffortRoute = true;
526
540
  }
527
541
  }
528
542
 
@@ -551,7 +565,11 @@ export function collapseEffortVariants<TSpec extends VariantSpecLike>(
551
565
  // falls back. Retired members never become the default.
552
566
  const defaultWireId = rawPresent.find(id => !retired?.has(id)) ?? rawPresent[0];
553
567
  if (defaultWireId === family.id) {
554
- delete collapsed.requestModelId;
568
+ if (usedAbsentEffortRoute) {
569
+ collapsed.requestModelId = defaultWireId as string;
570
+ } else {
571
+ delete collapsed.requestModelId;
572
+ }
555
573
  } else {
556
574
  collapsed.requestModelId = defaultWireId as string;
557
575
  }