fix: stop adding auto as Qoder model fallback

This commit is contained in:
Simon Shi
2026-07-22 19:42:46 +09:00
parent 1c44a09141
commit 55e87cbdef
4 changed files with 67 additions and 20 deletions
+5 -17
View File
@@ -345,6 +345,11 @@ export function getCachedModels(mode?: string): QoderModelDef[] {
try {
const data = JSON.parse(readFileSync(cachePath, "utf8"));
if (data && Array.isArray(data.models)) {
// Older releases injected `auto` without a corresponding service config.
// Keep an explicitly enabled service model, but drop the legacy fallback.
if (data.configs && typeof data.configs === "object" && !data.configs.auto) {
return data.models.filter((model: QoderModelDef) => model.id !== "auto");
}
return data.models;
}
} catch {}
@@ -504,23 +509,6 @@ export async function updateQoderModelsCache(
if (newModels.length === 0) return;
// Ensure auto is present
if (!newModels.some((m) => m.id === "auto")) {
newModels.unshift({
id: "auto",
name: isQoderCNMode(mode) ? "Auto · Qoder CN" : "Qoder Auto",
api: "qoder-api",
provider: isQoderCNMode(mode) ? "qoder-cn" : "qoder",
baseUrl: getQoderBaseUrl(mode),
reasoning: true,
supportsEffort: false,
input: ["text", "image"],
cost: ZERO_COST,
contextWindow: 180000,
maxTokens: 32768,
});
}
const cacheData = {
updatedAt: Date.now(),
models: newModels,