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(spec): record D623 model-settings redesign and align E2E probe
vastsa3bd70bee8f8c
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex cfbcc32ca..36986a0e1 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -7006,3 +7006,48 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.unmatched free-form IDs stay generic unknown, while published capabilitiesand explicit binding overrides retain their existing precedence. See`03-runtime/13-model-catalog-and-selection.md` §11.3.++## 2026-09-25 — Model settings unify around one AI service list and a chosen-models summary (D623)++- The model settings page asked too much before a user could connect anything.+ API-key services opened on a closed Service menu, vendor subscriptions had+ their own button and dialog further down the page, and plugin-declared+ services sat elsewhere again, so the first decision was where to look rather+ than what to connect. Users reported the flow as needlessly heavy. This+ redesign keeps the immersive, borderless D297 tone (in-flow surfaces use+ `--ds-tile`/`--ds-raised` and spacing, no borders; only floating menus and+ dialogs keep a 0.5px stroke and a shadow) and collapses the choices into one+ list and one add flow.+- API services, plugin-declared services and vendor subscription accounts now+ share a single AI service list (`ServiceList`, `ServiceRow`). A row is itself+ the way in — a click or Enter opens its editor — so the only controls left on+ a row are the enable switch and one overflow menu; the click lives on the row+ element rather than a button so a card drag still starts anywhere on the card.+ An account row still lives and dies through the vendor-account editor and+ `deleteOauthAccount`, never the provider CRUD, so ownership boundaries are+ unchanged even though the two kinds render in one list.+- Adding a service starts on a searchable chooser (`ServiceChooser`), not a+ closed menu: subscriptions and API-key services sit side by side as tiles and+ the custom endpoint comes last, because it is the one choice that asks for+ more than a key. Filtering never talks to the host. Picking a tile moves to+ the service form (`ProviderSetupDialog`, two views), and the credential rows+ live in their own component (`ProviderConnectionFields`, D310 + D623).+- Both the service dialog and the vendor-account dialog open on a chosen-models+ summary (`ChosenModelsSummary`) with the full two-pane picker+ (`ModelSelectionPanes`) one click away, because most people keep the models a+ service starts with. A new API service preselects recommended models+ (`recommended-models.ts`, `useRecommendedModelSelection`): only tool-capable+ chat models are candidates, and when models.dev metadata is present the newest+ stable model per family wins (up to `RECOMMENDED_MODEL_LIMIT`), with the first+ pick becoming the service default — so saving a key is enough to start+ chatting. Without trustworthy discovery (a rejected key, a timeout or a+ network failure) nothing is preselected; a named vendor that simply has no+ `/models` route still counts as accepting the key.+- Covered by `apps/desktop/test/service-chooser.test.mjs`,+ `service-catalog.test.mjs`, `service-row-status.test.mjs`,+ `recommended-models.test.mjs`, `provider-form-layout.test.mjs`,+ `default-model-display.test.mjs` and the updated `settings-general.test.mjs`,+ plus the `scripts/e2e/provider-api-style.tsx` probe (chooser tiles keyed by+ `data-service-id`, the custom endpoint last, and the account dialog opening on+ `provider-models-summary` with per-model controls behind Manage models and a+ folded Advanced disclosure). ADR 0098 still governs vendor OAuth accounts.diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex f15a537ac..50909e877 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -4958,3 +4958,37 @@ Markdown 源码,不是 `text/html` 负载;对禁用行内 HTML 的外部编只查自身目录。后缀本身不赋予推理能力:未命中的自由格式 ID 仍是未知通用模型,已发布能力和显式绑定覆盖沿用既有优先级。见`03-runtime/13-model-catalog-and-selection.md` §11.2。++## 2026-09-25 —— 模型设置统一为一份 AI 服务列表加一份已选模型摘要(D623)++- 模型设置页在用户连接任何服务前要求太多。API-key 服务打开时是一个收起的+ 服务菜单,订阅式厂商在页面靠下有自己的按钮和对话框,插件声明的服务又在+ 另一处,于是第一步的决定是"去哪看"而不是"连什么"。用户反馈流程过于繁重。+ 本次重设计保留沉浸式、无边框的 D297 基调(in-flow 面用+ `--ds-tile`/`--ds-raised` 与间距、不描边;只有浮层菜单和对话框保留 0.5px+ 描边和阴影),把这些选择收拢为一份列表和一条新增流程。+- API 服务、插件声明的服务和厂商订阅账号现在共享同一份 AI 服务列表+ (`ServiceList`、`ServiceRow`)。行本身就是入口——点击或回车打开它的编辑器+ ——因此行上只保留启用开关和一个溢出菜单;点击挂在行元素而非按钮上,这样卡片+ 拖拽仍可从卡片任意处开始。账号行仍通过厂商账号编辑器与 `deleteOauthAccount`+ 存续,绝不走 provider CRUD,所以即便两类在同一列表渲染,所有权边界不变。+- 新增服务从一个可搜索的选择器(`ServiceChooser`)开始,而非收起的菜单:订阅+ 与 API-key 服务并列成磁贴,自定义端点排最后,因为它是唯一需要不止一个密钥的+ 选择。过滤从不与 host 通信。选中磁贴后进入服务表单(`ProviderSetupDialog`,+ 两个视图),凭据行独立成组件(`ProviderConnectionFields`,D310 + D623)。+- 服务对话框与厂商账号对话框都打开在已选模型摘要(`ChosenModelsSummary`)上,+ 完整的双栏选择器(`ModelSelectionPanes`)只需一次点击,因为多数人会保留服务+ 自带的模型。新的 API 服务会预选推荐模型(`recommended-models.ts`、+ `useRecommendedModelSelection`):只有可调用工具的对话模型才是候选,存在+ models.dev 元数据时每个家族取最新稳定型(至多 `RECOMMENDED_MODEL_LIMIT` 个),+ 首个入选成为服务默认——因此保存一个密钥就足以开始对话。缺乏可信发现结果时+ (密钥被拒、超时或网络失败)不预选;仅是没有 `/models` 路由的已知厂商仍算作+ 接受了密钥。+- 覆盖测试:`apps/desktop/test/service-chooser.test.mjs`、+ `service-catalog.test.mjs`、`service-row-status.test.mjs`、+ `recommended-models.test.mjs`、`provider-form-layout.test.mjs`、+ `default-model-display.test.mjs` 及更新后的 `settings-general.test.mjs`,+ 另加 `scripts/e2e/provider-api-style.tsx` 探针(选择器磁贴以 `data-service-id`+ 标记、自定义端点排最后、账号对话框打开在 `provider-models-summary` 上、每模型+ 控件位于"管理模型"和折叠的"高级"展开项之后)。厂商 OAuth 账号仍由 ADR 0098+ 管辖。diff --git a/scripts/e2e/provider-api-style.tsx b/scripts/e2e/provider-api-style.tsxindex b6054e70c..3a90cc498 100644--- a/scripts/e2e/provider-api-style.tsx+++ b/scripts/e2e/provider-api-style.tsx@@ -8,6 +8,7 @@ import { ProviderSetupDialog, type ProviderSetupDialogProps } from "../../apps/dimport { VendorAccountDialog, type VendorAccountForm } from "../../apps/desktop/src/components/settings/VendorAccountDialog";import { API_STYLE_LABEL_KEYS, CUSTOM_PROVIDER_API_STYLES } from "../../apps/desktop/src/components/settings/provider-api-style";import { copyProviderConfiguration } from "../../apps/desktop/src/components/settings/provider-copy";+import { CUSTOM_SERVICE } from "../../apps/desktop/src/components/settings/service-catalog";import { api } from "../../apps/desktop/src/lib/api";declare global { var providerApiStyleProbe: () => Promise<unknown>; }@@ -156,13 +157,15 @@ globalThis.providerApiStyleProbe = async () => {for (const locale of ["en", "zh-CN"]) {await i18n.changeLanguage(locale);render();- const serviceTrigger = document.querySelector<HTMLButtonElement>(".provider-service-trigger");- assert(serviceTrigger, "service picker trigger missing");- serviceTrigger.scrollIntoView({ block: "center" });- await frame();- click(serviceTrigger);- click(document.querySelector(".provider-service-option"));+ // A new service opens on the chooser (D623); the custom endpoint is the+ // last tile, and picking it moves to the form.+ const tiles = [...document.querySelectorAll<HTMLButtonElement>("[data-service-id]")];+ assert(tiles.length > 1, `${locale}: service chooser tiles missing`);+ assert(tiles.at(-1)?.dataset.serviceId === CUSTOM_SERVICE, `${locale}: custom endpoint is not last`);+ assert(!apiStyleTrigger(), `${locale}: form rendered before a service was chosen`);+ click(tiles.at(-1));await frame();+ assert(!document.querySelector("[data-service-id]"), `${locale}: chooser stayed open after a pick`);await openApiStyleMenu();const newCustomOptions = optionSnapshot();assert(JSON.stringify(newCustomOptions.map((option) => option.label)) === JSON.stringify(customLabels()),@@ -226,6 +229,15 @@ globalThis.providerApiStyleProbe = async () => {let savedCodexAccount: VendorAccountForm | undefined;flushSync(() => root.render(<I18nextProvider i18n={i18n}><VendorAccountDialog provider={codexAccount} initialName={codexAccount.name} onClose={() => { closes++; }} onSave={(form) => { savedCodexAccount = structuredClone(form); }} saving={false} /></I18nextProvider>));await pause(650);+ // Models open as a summary (D623); the per-model controls sit behind+ // Manage models and the row's own Advanced disclosure.+ assert(document.querySelector(".provider-models-summary"), `${locale}: account dialog did not open on the summary`);+ click(control("settings.manageModels"));+ await frame();+ const advancedToggle = document.querySelector<HTMLButtonElement>(".provider-chosen-advanced-toggle");+ assert(advancedToggle?.getAttribute("aria-expanded") === "false", `${locale}: a model opened its advanced settings on its own`);+ click(advancedToggle);+ await frame();const findWebSearch = () => [...document.querySelectorAll<HTMLInputElement>("input[type=checkbox]")].find((input) => input.closest("label")?.textContent?.trim() === i18n.t("settings.nativeWebSearch"));const searchCheckbox = findWebSearch();assert(searchCheckbox, `${locale}: Codex web search checkbox missing`);