Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
Merge upstream/main into feat/fast-mode-1657
zszz3dfefc912e87d
diff --cc docs/project/unreleased.mdindex 5699e1462,4809010b8..69b504767--- a/docs/project/unreleased.md+++ b/docs/project/unreleased.md@@@ -1,11 -1,3 +1,7 @@@# Unreleased changes-No unreleased changes. See the in-app changelog for version 0.21.0.+- Add OpenAI Fast mode (#1657). Allow it per model in Settings → Models for a+ ChatGPT subscription or an OpenAI Responses connection, then type `/fast` to+ turn it on for the current conversation. Requests ask for the priority+ service tier, which replies faster and spends plan limits faster or bills+ more per token; the Composer model chip shows a Fast mark while it is on.- - Upgrade the Pi agent, model adapters, native-session SDK, and MCP client from- 1.1.0 to 1.3.0. Preserve Desktop compatibility patches, omit foreign-model- thinking from replay, reject malformed final tool JSON before execution, and- expose the user-run discriminator to trusted extension startup handlers.diff --cc docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex 8af097099,0d853866b..81dd8fc4f--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@@ -9873,20 -9942,20 +9942,38 @@@ host-created files. The full app's file- **验收**:项目折叠时仍能回答“这里是否有正在运行的工作”,且两种提示可从持久化设置独立控制。- **状态**:草稿。现有 `apps/desktop/test/sidebar-project-runs.test.mjs` 覆盖数量分类、总开关与子开关门控、两种渲染入口,以及主题令牌和减少动态效果保证;它不覆盖设置 API 缺省值规范化或完整交互,相关场景仍需在可用环境手动验证。+### E2E-FAST-MODE:`/fast` 只在允许的模型上请求优先档位++- **前置条件**:一个 ChatGPT 订阅(Codex)账号和一个 Responses API key 提供商,各配置两个模型。+ 自动化路径不需要真实提供商;手动路径使用可捕获请求的本地端点或用户授权的账号。+- **步骤**:+ 1. 在「设置 → 模型」中为每个提供商的一个模型勾选 **Fast 模式**;确认 Chat Completions 提供商上该勾选框不可用。+ 2. 在允许的 Codex 模型上新建任务,输入 `/fast`,发送一条提示。+ 3. 再次发送 `/fast`,然后再发送一条提示。+ 4. 把会话切换到未允许的模型,发送 `/fast`。+ 5. 在 Fast 开启时 fork 会话;重启应用后重新打开两个会话。+- **预期**:第 1 步只在 binding 上保存 `fastModeAllowed`。第 2 步模型芯片显示 Fast 标识,请求体带有+ `service_tier: "priority"`;Responses API key 模型改为提示按 token 计费的价格。第 3 步清除标识和该字段。+ 第 4 步给出模型设置提示并拒绝,不保存任何状态。第 5 步 fork 和重启后开关保持开启。子代理和压缩请求+ 从不携带该字段。远程会话拒绝 `/fast`。+- **关联规格**:`03-runtime/11-provider-model-system.md`、`03-runtime/04-data-storage.md`(v25)、+ `04-ux/04-builtin-commands.md`、ADR 0334、issue #1657。+- **状态**:自动化覆盖见英文版。完整的设置 → `/fast` → 捕获请求路径为手动验证场景。+++ #### E2E-PROVIDER-reasoning-effort-override: Preserve an explicit gateway reasoning parameter++ - **Setup:** A custom Chat Completions provider with a DeepSeek-family model;+ start with a legacy binding that omits `supportsReasoningEffort`.+ - **Steps:** In English, Chinese and German at 850/1000/1400px widths, open model settings, confirm Auto, select+ Send, save and reopen; repeat for Do not send and Auto. Switch to Responses+ and Anthropic and confirm the Completions-only control is hidden.+ - **Expected:** Each saved binding retains true, false, or null respectively.+ With High selected, the real Completions adapter sends `reasoning_effort: high`+ only when enabled; Auto keeps the existing DeepSeek compatibility default.+ Responses continues using its own reasoning contract. Provider creation,+ update/read, copying, and sync preserve the explicit override.+ - **Automation:** `node scripts/e2e-provider-api-style.mjs --reasoning-effort` exercises real+ React/Chromium controls and captures the Host API payload (the IPC boundary is+ stubbed). Rust provider tests independently verify real SQLite persistence;+ `provider-reasoning-effort.test.ts` captures requests from the real pi-ai+ adapter with fixture SSE responses. No live gateway credentials are required.diff --cc packages/shared/src/provider-sync.tsindex 467f1064f,7d280eae3..8db9c67af--- a/packages/shared/src/provider-sync.ts+++ b/packages/shared/src/provider-sync.ts@@@ -23,7 -23,7 +23,7 @@@ const API_STYLES = new Set(["auto", "chconst EXCLUDED_VENDORS = new Set(["claude-cli", "codex", "openai-codex", "github-copilot", "google-antigravity", "google-gemini-cli", "ollama", "lmstudio", "lm-studio", "local"]);const RESERVED_HEADERS = new Set(["authorization", "proxy-authorization", "x-api-key", "api-key", "x-goog-api-key", "cookie", "set-cookie", "host", "content-type", "content-length", "connection", "transfer-encoding", "te", "trailer", "upgrade", "keep-alive", "chatgpt-account-id", "x-opencode-session"]);const INPUT_FIELDS = ["name", "vendorKey", "type", "protocol", "baseUrl", "authKind", "models", "defaultModelId", "secretValue", "apiStyle", "headers", "supportsReasoning", "supportedThinkingLevels", "contextWindow", "maxOutputTokens", "temperature"];- const MODEL_FIELDS = ["id", "alias", "contextWindow", "contextWindowSource", "maxTokens", "maxTokensSource", "thinkingLevels", "defaultThinkingLevel", "thinkingProtocol", "supportsImages", "supportsDocuments", "availableForSubagents", "nativeWebSearch", "fastModeAllowed"];-const MODEL_FIELDS = ["id", "alias", "contextWindow", "contextWindowSource", "maxTokens", "maxTokensSource", "thinkingLevels", "defaultThinkingLevel", "thinkingProtocol", "supportsReasoningEffort", "supportsImages", "supportsDocuments", "availableForSubagents", "nativeWebSearch"];++const MODEL_FIELDS = ["id", "alias", "contextWindow", "contextWindowSource", "maxTokens", "maxTokensSource", "thinkingLevels", "defaultThinkingLevel", "thinkingProtocol", "supportsReasoningEffort", "supportsImages", "supportsDocuments", "availableForSubagents", "nativeWebSearch", "fastModeAllowed"];function invalid(): never {// Never include input values, unknown field names, parser diagnostics or causes.@@@ -82,10 -82,10 +82,10 @@@ function validateModel(value: unknown)const thinking = value.defaultThinkingLevel;if (thinking !== null && thinking !== "omit" && !(typeof thinking === "string" && (value.thinkingLevels as string[]).includes(thinking))) invalid();if (value.thinkingProtocol !== undefined && value.thinkingProtocol !== "legacy" && value.thinkingProtocol !== "adaptive") invalid();- for (const key of ["supportsImages", "supportsDocuments"] as const) {+ for (const key of ["supportsImages", "supportsDocuments", "supportsReasoningEffort"] as const) {if (value[key] !== undefined && value[key] !== null && typeof value[key] !== "boolean") invalid();}- for (const key of ["availableForSubagents", "nativeWebSearch"] as const) {+ for (const key of ["availableForSubagents", "nativeWebSearch", "fastModeAllowed"] as const) {if (value[key] !== undefined && typeof value[key] !== "boolean") invalid();}return value as ModelBinding;