add deprecated model fallback chain resolution

models can now be marked `deprecated: true` with a `fallback` slug
pointing to a replacement. `resolveCliModel` follows the chain
recursively (with cycle detection) until it finds a non-deprecated
model. this keeps deprecated models in the registry for backward
compatibility instead of removing them.

marks opencode/mimo-v2-pro-free as deprecated with fallback to
opencode/nemotron-3-super-free.

Made-with: Cursor
This commit is contained in:
Colin McDonnell
2026-04-03 18:45:47 +00:00
committed by pullfrog[bot]
parent a45c164b18
commit b8c4d5b716
6 changed files with 87 additions and 26 deletions
+21 -10
View File
@@ -107842,7 +107842,9 @@ var providers = {
displayName: "MiMo V2 Pro",
resolve: "opencode/mimo-v2-pro-free",
envVars: [],
isFree: true
isFree: true,
deprecated: true,
fallback: "opencode/nemotron-3-super-free"
},
"minimax-m2.5-free": {
displayName: "MiniMax M2.5",
@@ -107951,14 +107953,25 @@ var modelAliases = Object.entries(providers).flatMap(
resolve: def.resolve,
openRouterResolve: def.openRouterResolve,
preferred: def.preferred ?? false,
isFree: def.isFree ?? false
isFree: def.isFree ?? false,
deprecated: def.deprecated ?? false,
fallback: def.fallback
}))
);
function resolveModelSlug(slug) {
return modelAliases.find((a) => a.slug === slug)?.resolve;
}
var MAX_FALLBACK_DEPTH = 10;
function resolveCliModel(slug) {
return resolveModelSlug(slug);
let current = slug;
const visited = /* @__PURE__ */ new Set();
for (let i = 0; i < MAX_FALLBACK_DEPTH; i++) {
if (visited.has(current)) return void 0;
visited.add(current);
const alias = modelAliases.find((a) => a.slug === current);
if (!alias) return void 0;
if (!alias.deprecated) return alias.resolve;
if (!alias.fallback) return void 0;
current = alias.fallback;
}
return void 0;
}
// utils/buildPullfrogFooter.ts
@@ -144696,7 +144709,7 @@ var import_semver = __toESM(require_semver2(), 1);
// package.json
var package_default = {
name: "@pullfrog/pullfrog",
version: "0.0.188",
version: "0.0.189",
type: "module",
files: [
"index.js",
@@ -149541,7 +149554,7 @@ var claude = agent({
// agents/opentoad.ts
import { execFileSync as execFileSync3 } from "node:child_process";
import { mkdirSync as mkdirSync4, rmSync } from "node:fs";
import { mkdirSync as mkdirSync4 } from "node:fs";
import { join as join11 } from "node:path";
import { performance as performance7 } from "node:perf_hooks";
async function installOpencodeCli() {
@@ -149925,8 +149938,6 @@ var opentoad = agent({
env: homeEnv,
agent: "opencode"
});
rmSync(join11(process.cwd(), ".opencode", "plugins"), { recursive: true, force: true });
rmSync(join11(process.cwd(), ".opencode", "tools"), { recursive: true, force: true });
const args2 = ["run", ctx.instructions.full, "--format", "json", "--print-logs"];
const permissionOverride = JSON.stringify({
external_directory: { "*": "deny", "/tmp/*": "allow" }