Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
docs: align the removal semantics and the e2e assertion with the implementation
vastsada39364eafbd
diff --git a/docs/spec/03-runtime/21-image-generation.md b/docs/spec/03-runtime/21-image-generation.mdindex d620fd43d..851ce5ea2 100644--- a/docs/spec/03-runtime/21-image-generation.md+++ b/docs/spec/03-runtime/21-image-generation.md@@ -4,15 +4,15 @@ The desktop exposes `AppSettings.imageGeneration` as the current default image-g## Configuration-Model Advanced exposes **Set as image model** alongside the image and document attachment capabilities in the model capability group, not as a separate control row. The checkbox is multi-select: saving a provider persists every checked model in `imageGenerationModels`; Cancel leaves settings unchanged. Saving candidates does not replace the default conversation model. Unchecking the current image model and saving removes its default binding: the first remaining runnable candidate becomes the default, or the default becomes null if none remains. The unmarked model is available for chat again after saving and reopening settings. Saving another provider preserves a still-runnable image default. Below the default model row in the same defaults panel, **Image generation model** shows the current default and offers a menu to choose one from all marked candidates. When no candidate is configured, the summary row is hidden. An existing candidate that is missing, disabled, credential-less or removed displays only **Currently unavailable**. OAuth accounts are not eligible; there is no fallback.+Model Advanced exposes **Set as image model** alongside the image and document attachment capabilities in the model capability group, not as a separate control row. The checkbox is multi-select: saving a provider persists every checked model in `imageGenerationModels`; Cancel leaves settings unchanged. Saving candidates does not replace the default conversation model. Unchecking the current image model and saving removes its default binding: the default becomes null, even when another runnable candidate remains. The unmarked model is available for chat again after saving and reopening settings. Saving another provider preserves a still-runnable image default. Below the default model row in the same defaults panel, **Image generation model** shows the current default and offers a menu to choose one from all marked candidates. When no candidate is configured, the summary row is hidden. An existing candidate that is missing, disabled, credential-less or removed displays only **Currently unavailable**. OAuth accounts are not eligible; there is no fallback.All marked provider/model pairs are excluded from the default conversation picker, provider quick-default action, and Composer model menu. Other providers with the same model ID remain independent. Existing conversation bindings and history are preserved; a conversation still pinned to any image candidate must select a chat model before sending. Runtime launch rejects every marked image model before inference.### Provider model removalSaving a provider after explicitly removing a configured model also removesthat model's image candidate, even if the image capability checkbox was not-touched. If it was the active image default, select the first remaining-runnable candidate or clear the default when none remains. Cancel preserves+touched. If it was the active image default, clear the default, even when another+runnable candidate remains on this or another provider. Cancel preservesboth the provider models and the image settings. Legacy single bindings followthe same rule. Unchanged image selections retain the ordinary provider-savepath. External provider changes can still leave an unavailable binding visible.diff --git a/docs/zh-CN/spec/03-runtime/21-image-generation.md b/docs/zh-CN/spec/03-runtime/21-image-generation.mdindex 295dc5af1..6e6767c31 100644--- a/docs/zh-CN/spec/03-runtime/21-image-generation.md+++ b/docs/zh-CN/spec/03-runtime/21-image-generation.md@@ -6,14 +6,13 @@## 配置-模型高级设置将“设为生图模型”与图片、文档附件能力放在同一能力组中,不再单独占一行;复选框支持多选,保存服务商表单后把所有勾选模型写入 `imageGenerationModels`,取消不会改变设置。保存候选不会替换默认对话模型。取消勾选当前生图模型并保存后,默认生图绑定改为剩余的第一个可用候选;没有可用候选时清空。取消标记的模型恢复为可选对话模型,重新打开设置后仍保持这一状态。保存其他服务商时保留仍可用的默认生图模型。默认模型下方同一面板中的“生图模型”显示当前默认,并提供菜单从所有已标记候选中选择一个。没有候选时隐藏摘要行;已存在但服务商停用、缺少凭据或模型移除的候选仅显示“暂不可用”。OAuth 账户不适用,也不会自动回退。+模型高级设置将“设为生图模型”与图片、文档附件能力放在同一能力组中,不再单独占一行;复选框支持多选,保存服务商表单后把所有勾选模型写入 `imageGenerationModels`,取消不会改变设置。保存候选不会替换默认对话模型。取消勾选当前生图模型并保存后,默认生图绑定清空,即使仍有其他可用候选。取消标记的模型恢复为可选对话模型,重新打开设置后仍保持这一状态。保存其他服务商时保留仍可用的默认生图模型。默认模型下方同一面板中的“生图模型”显示当前默认,并提供菜单从所有已标记候选中选择一个。没有候选时隐藏摘要行;已存在但服务商停用、缺少凭据或模型移除的候选仅显示“暂不可用”。OAuth 账户不适用,也不会自动回退。所有已标记的服务商/模型组合都会从默认对话模型选择器、服务商快速设为默认操作和 Composer 模型菜单中排除。其他服务商的同名模型独立保留。已有会话绑定和历史不改写;仍绑定任一生图候选的会话必须选择对话模型才能发送,运行时也会在推理前拒绝所有已标记生图模型。### 移除服务商模型在服务商编辑器中主动移除已配置模型并保存时,即使没有操作生图能力复选框,-也会清除该模型的生图候选。如果它是当前默认生图模型,则选择剩余的第一个-可用候选;没有可用候选时清空默认值。取消编辑保留模型列表和生图设置。+也会清除该模型的生图候选。如果它是当前默认生图模型,则清空默认值,即使其他服务商仍有可用候选。取消编辑保留模型列表和生图设置。旧版单绑定配置遵循相同规则。生图选择未改变时保留原有服务商保存流程。服务商的外部变化仍可能留下显示为“暂不可用”的绑定。若当前聊天默认模型也被移除,仍按原有规则选择服务商的第一个剩余模型;diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex a07c0c8e5..4c7af1216 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -8365,8 +8365,8 @@ the latest destination. These assertions measure work counts, not device FPS.分别测试旧版单绑定和另一服务商仍有可用生图候选的情况。- **步骤:** 不操作生图复选框,直接移除已标记模型;先取消,再重复并保存,重新打开设置和编辑器。-- **预期:** 取消保留配置;保存清除已移除模型的生图候选,默认值清空或切换- 至剩余可用候选;保留仍存在的聊天默认模型,被移除的聊天默认模型按原有+- **预期:** 取消保留配置;保存清除已移除模型的生图候选并清空生图默认值,即使+ 仍有其他可用候选;保留仍存在的聊天默认模型,被移除的聊天默认模型按原有规则改为第一个剩余模型,重新打开后状态保持。- **规格:** 03-runtime/21-image-generation。**验收:** B。- **里程碑:** 维护。**状态:** `scripts/e2e-image-generation-ui.mjs`diff --git a/scripts/e2e/image-generation-ui.tsx b/scripts/e2e/image-generation-ui.tsxindex 2bb125eec..359a7b6aa 100644--- a/scripts/e2e/image-generation-ui.tsx+++ b/scripts/e2e/image-generation-ui.tsx@@ -319,7 +319,7 @@ globalThis.imageGenerationProbe = async () => {click(button(i18n.t("settings.saveProvider")));await until(() => !document.querySelector(".provider-setup-dialog"), "model removal save did not finish");assert(!providers[0].models.some((model) => model.id === "image-one"), "model was not removed");- assert(settings.imageGeneration?.providerId === (remaining ? "q" : undefined),+ assert(settings.imageGeneration?.providerId === undefined,"removed provider model kept the image default");assert(settings.imageGenerationModels?.length === (remaining ? 1 : 0),"removed provider model kept an image candidate");