fix(ai): restore default model configuration

This commit is contained in:
zipg authored and GitHub committed 2026-08-02 10:09:01 +08:00
1 parent 8379f0d048
commit 2dffbb9286
2 files changed
+15

No files matched your search

+9
View File
@@ -548,6 +548,15 @@ test("AI provider presets include common hosted and local providers", () => {
assert.ok(Object.keys(AI_PROVIDER_PRESETS).indexOf("codex-cli") < Object.keys(AI_PROVIDER_PRESETS).indexOf("pi-agent-cli"));
});
test("API AI provider settings expose and persist a default model ID", () => {
const source = readFileSync("apps/desktop/src/components/editor/EditorSettingsDialog.vue", "utf8");
const modelControl = source.indexOf('<Input v-model="aiEditModel"');
assert.ok(modelControl >= 0);
assert.match(source.slice(modelControl - 300, modelControl + 300), /v-if="!aiIsCliProvider"[\s\S]*t\("ai\.defaultModel"\)[\s\S]*t\('ai\.manualModelPlaceholder'\)/);
assert.match(source, /model:\s*aiEditModel\.value/);
});
test("normalizes legacy AI config and fills provider defaults", () => {
const legacy = normalizeAiConfig({
provider: "openai",