Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

Merge branch 'main' into fix/image-model-save-feedback

vastsac0163172dd99
diff --cc apps/desktop/src/components/settings/ModelConfigPage.tsx
index 510f2f0b3,343079422..3f9a015ac
--- a/apps/desktop/src/components/settings/ModelConfigPage.tsx
+++ b/apps/desktop/src/components/settings/ModelConfigPage.tsx
@@@ -200,13 -205,17 +205,19 @@@ export function ModelConfigPage()
saved.id,
imageModelIds,
[...providers.filter((provider) => provider.id !== saved.id), saved],
+ current.imageGeneration?.providerId === saved.id &&
+ !saved.models.some((model) => modelIdsMatch(model.id, current.imageGeneration?.modelId ?? "")),
);
- const nextSettings = { ...current, ...plan };
+ const nextSettings = {
+ ...current,
+ ...plan,
+ ...(replacementChatModelId ? { defaultModelId: replacementChatModelId } : {}),
+ };
await api.setSettings(nextSettings);
useAppStore.setState({ settings: nextSettings });
- showToast(t("settings.imageModelSelected"), { variant: "success" });
+ showToast(t(editingProvider ? "settings.providerUpdated" : "settings.providerSaved"), {
+ variant: "success",
+ });
} else if (copyDraft) {
showToast(t("settings.providerSaved"), { variant: "success" });
} else if (!editingProvider) {
diff --cc docs/spec/03-runtime/21-image-generation.md
index 7f7ea530f,851ce5ea2..fa9c08101
--- a/docs/spec/03-runtime/21-image-generation.md
+++ b/docs/spec/03-runtime/21-image-generation.md
@@@ -4,14 -4,21 +4,26 @@@ The desktop exposes `AppSettings.imageG
## Configuration
+Saving a provider confirms the provider was saved or updated, including when
+image capabilities were marked or unmarked. It must not claim that an image
+model was selected after deselection. Choosing an image default from the
+summary menu retains the image-selection confirmation.
+
- 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 removal
+
+ Saving a provider after explicitly removing a configured model also removes
+ that model's image candidate, even if the image capability checkbox was not
+ touched. If it was the active image default, clear the default, even when another
+ runnable candidate remains on this or another provider. Cancel preserves
+ both the provider models and the image settings. Legacy single bindings follow
+ the same rule. Unchanged image selections retain the ordinary provider-save
+ path. External provider changes can still leave an unavailable binding visible.
+ The existing chat-default repair still runs if the saved provider no longer
+ contains its selected chat model; otherwise the chat default is preserved.
+
## Agent contract
`GenerateImages({items: [{prompt, count?, images?}]})` is an Agent-mode tool.
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index e0d408e05,d26087f5a..2c102aad8
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -8,16 -8,21 +8,31 @@@
## 1. Goals
+### E2E-IMAGES-provider-save-feedback
+
+- **Preconditions:** Image configuration UI fixture; English and Chinese.
+- **Steps:** Mark image models and save the provider; choose a different image
+ default from its summary; then unmark the sole image model and save.
+- **Expected:** Provider edits confirm the provider update, including after
+ clearing the image selection. Explicit default selection keeps its specific
+ image-selection confirmation. Persisted bindings retain their existing behavior.
+- **Specs:** 03-runtime/21-image-generation. **Acceptance:** B.
+- **Milestone:** Maintenance. **Status:** Automated by
+ ### E2E-IMAGES-remove-configured-model
+
+ - **Preconditions:** API-boundary fixture with an image-marked model and another
+ configured model on its provider; repeat with legacy single binding and with
+ another image candidate on another provider.
+ - **Steps:** Remove the marked model in the provider editor without toggling its
+ image checkbox. Cancel once, repeat and Save, then reopen settings and editor.
+ - **Expected:** Cancel preserves both configurations. Save removes the model and
+ its image candidate and clears the image default, even when another image
+ candidate remains on this or another provider. The settings summary therefore
+ shows the unavailable state until the user explicitly chooses a new default.
+ An unaffected chat default stays unchanged; a removed chat default still falls
+ back to the first configured model. Reload preserves results.
+ - **Specs:** 03-runtime/21-image-generation. **Acceptance:** B.
+ - **Milestone:** Maintenance. **Status:** Automated in English and Chinese by
`scripts/e2e-image-generation-ui.mjs`.
### E2E-IMAGES-desktop-conversation
diff --cc docs/zh-CN/spec/03-runtime/21-image-generation.md
index 732d3a301,6e6767c31..f75b7b927
--- a/docs/zh-CN/spec/03-runtime/21-image-generation.md
+++ b/docs/zh-CN/spec/03-runtime/21-image-generation.md
@@@ -6,13 -6,18 +6,22 @@@
## 配置
+保存服务商时,无论是否勾选或取消生图标记,成功提示都确认“服务已保存”
+或“服务已更新”,避免取消标记后仍声称“已设为生图模型”。
+从生图摘要菜单选择默认模型时,仍显示生图选择成功提示。
+
- 模型高级设置将“设为生图模型”与图片、文档附件能力放在同一能力组中,不再单独占一行;复选框支持多选,保存服务商表单后把所有勾选模型写入 `imageGenerationModels`,取消不会改变设置。保存候选不会替换默认对话模型。取消勾选当前生图模型并保存后,默认生图绑定改为剩余的第一个可用候选;没有可用候选时清空。取消标记的模型恢复为可选对话模型,重新打开设置后仍保持这一状态。保存其他服务商时保留仍可用的默认生图模型。默认模型下方同一面板中的“生图模型”显示当前默认,并提供菜单从所有已标记候选中选择一个。没有候选时隐藏摘要行;已存在但服务商停用、缺少凭据或模型移除的候选仅显示“暂不可用”。OAuth 账户不适用,也不会自动回退。
+ 模型高级设置将“设为生图模型”与图片、文档附件能力放在同一能力组中,不再单独占一行;复选框支持多选,保存服务商表单后把所有勾选模型写入 `imageGenerationModels`,取消不会改变设置。保存候选不会替换默认对话模型。取消勾选当前生图模型并保存后,默认生图绑定清空,即使仍有其他可用候选。取消标记的模型恢复为可选对话模型,重新打开设置后仍保持这一状态。保存其他服务商时保留仍可用的默认生图模型。默认模型下方同一面板中的“生图模型”显示当前默认,并提供菜单从所有已标记候选中选择一个。没有候选时隐藏摘要行;已存在但服务商停用、缺少凭据或模型移除的候选仅显示“暂不可用”。OAuth 账户不适用,也不会自动回退。
所有已标记的服务商/模型组合都会从默认对话模型选择器、服务商快速设为默认操作和 Composer 模型菜单中排除。其他服务商的同名模型独立保留。已有会话绑定和历史不改写;仍绑定任一生图候选的会话必须选择对话模型才能发送,运行时也会在推理前拒绝所有已标记生图模型。
+ ### 移除服务商模型
+
+ 在服务商编辑器中主动移除已配置模型并保存时,即使没有操作生图能力复选框,
+ 也会清除该模型的生图候选。如果它是当前默认生图模型,则清空默认值,即使其他服务商仍有可用候选。取消编辑保留模型列表和生图设置。
+ 旧版单绑定配置遵循相同规则。生图选择未改变时保留原有服务商保存流程。
+ 服务商的外部变化仍可能留下显示为“暂不可用”的绑定。
+ 若当前聊天默认模型也被移除,仍按原有规则选择服务商的第一个剩余模型;
+ 否则保留聊天默认值。
+
## Agent 合约
`GenerateImages({items: [{prompt, count?, images?}]})` 仅供 Agent 模式使用。`count` 默认为 1,支持不同提示词和同一提示词的多个变体,总输出为 1–10 张。每项可通过 `images` 提供 1–4 张本地参考图,之前生成的路径可用于迭代编辑。提示词最多 32,000 个字符;不支持或超限输入直接拒绝,不截断。Plan 和 Goal 不得执行此工具。
diff --cc scripts/e2e/image-generation-ui.tsx
index b427c991d,359a7b6aa..d2b85798c
--- a/scripts/e2e/image-generation-ui.tsx
+++ b/scripts/e2e/image-generation-ui.tsx
@@@ -335,7 -388,7 +394,8 @@@ globalThis.imageGenerationProbe = asyn
ok: true,
locales: ["en", "zh-CN"],
scenarios: [
+ "provider-save-feedback-for-image-mark-and-unmark",
+ "remove-marked-model-cancel-save-reopen-and-clear",
"advanced-save-cancel",
"unmark-only-image-model-save-reopen-chat-selection",
"advanced-provider-switch",