Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
feat(settings): allow omit as a model default thinking level
vastsa605d9fa729ac
diff --git a/apps/desktop/src/components/settings/ModelSelectionPanes.tsx b/apps/desktop/src/components/settings/ModelSelectionPanes.tsxindex e2f5bfe31..72040c97c 100644--- a/apps/desktop/src/components/settings/ModelSelectionPanes.tsx+++ b/apps/desktop/src/components/settings/ModelSelectionPanes.tsx@@ -12,15 +12,18 @@ import { useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";import {THINKING_LEVELS,+ bindingDefaultThinkingMenuLevels,bindingForCustomModel,bindingFromModelInfo,formatTokenCount,modelMatchesFilter,nativeWebSearchSupportedOn,publishedThinkingLevels,+ resolveBindingDefaultThinkingLevel,sortThinkingLevels,type ModelBinding,type ModelInfo,+ type SessionThinkingLevel,type ThinkingLevel,} from "@pi-desktop/shared";import {@@ -129,10 +132,10 @@ export function useModelSelection(// would save a different default than the one the user was shown.const thinkingLevels = sortThinkingLevels(binding.thinkingLevels);const enabled = thinkingLevels;- const defaultThinkingLevel =- binding.defaultThinkingLevel && enabled.includes(binding.defaultThinkingLevel)- ? binding.defaultThinkingLevel- : (enabled[0] ?? null);+ const defaultThinkingLevel = resolveBindingDefaultThinkingLevel(+ binding.defaultThinkingLevel,+ enabled,+ );if (thinkingLevels.length === binding.thinkingLevels.length &&defaultThinkingLevel === binding.defaultThinkingLevel@@ -732,7 +735,7 @@ export function ModelSelectionPanes({{t("settings.thinkingManualOverrideHint")}</span>) : null}- {enabledLevels.length > 1 ? (+ {bindingDefaultThinkingMenuLevels(enabledLevels).length > 1 ? (<div className="provider-chosen-thinking-default"><span className="provider-chosen-thinking-label">{t("settings.defaultThinkingLevel")}@@ -741,20 +744,22 @@ export function ModelSelectionPanes({className="provider-chosen-thinking-select"label={t("settings.defaultThinkingLevel")}value={- binding.defaultThinkingLevel &&- enabledLevels.includes(binding.defaultThinkingLevel)- ? binding.defaultThinkingLevel- : (enabledLevels[0] ?? "")+ resolveBindingDefaultThinkingLevel(+ binding.defaultThinkingLevel,+ enabledLevels,+ ) ?? ""}onChange={(id) =>updateBinding(binding.id, {- defaultThinkingLevel: id as ThinkingLevel,+ defaultThinkingLevel: id as SessionThinkingLevel,})}- options={enabledLevels.map((level) => ({- id: level,- label: level,- }))}+ options={bindingDefaultThinkingMenuLevels(enabledLevels).map(+ (level) => ({+ id: level,+ label: level,+ }),+ )}/></div>) : null}@@ -782,11 +787,10 @@ export function ModelSelectionPanes({: [...binding.thinkingLevels, level];updateBinding(binding.id, {thinkingLevels: next,- defaultThinkingLevel: next.includes(- binding.defaultThinkingLevel as ThinkingLevel,- )- ? binding.defaultThinkingLevel- : (sortThinkingLevels(next)[0] ?? null),+ defaultThinkingLevel: resolveBindingDefaultThinkingLevel(+ binding.defaultThinkingLevel,+ sortThinkingLevels(next),+ ),});}}>diff --git a/apps/desktop/test/model-advanced-capabilities.test.mjs b/apps/desktop/test/model-advanced-capabilities.test.mjsindex af83ad2ee..c047ba584 100644--- a/apps/desktop/test/model-advanced-capabilities.test.mjs+++ b/apps/desktop/test/model-advanced-capabilities.test.mjs@@ -32,15 +32,15 @@ const sidecarSource = await readFile();const styles = await loadStyles();-test("advanced settings choose the default thinking level among the enabled ones", () => {+test("advanced settings choose the default thinking level among omit and the enabled ones", () => {// Offering the published ladder instead of the enabled subset would store a- // default the runtime clamps away on the next request.+ // default the runtime clamps away on the next request. omit is a client+ // selector, so it sits on the default picker rather than the capability chips.assert.match(pickerSource, /settings\.defaultThinkingLevel/);assert.match(pickerSource, /const enabledLevels = sortThinkingLevels\(/);- assert.match(pickerSource, /enabledLevels\.map\(\(level\) => \(/);- assert.match(pickerSource, /defaultThinkingLevel: id as ThinkingLevel/);- // Nothing to choose when a binding enables one level or none.- assert.match(pickerSource, /enabledLevels\.length > 1 \?/);+ assert.match(pickerSource, /bindingDefaultThinkingMenuLevels\(enabledLevels\)\.map/);+ assert.match(pickerSource, /defaultThinkingLevel: id as SessionThinkingLevel/);+ assert.match(pickerSource, /bindingDefaultThinkingMenuLevels\(enabledLevels\)\.length > 1 \?/);});test("the capability checkboxes show and follow the published value", () => {@@ -236,13 +236,17 @@ test("the offered default and the saved default use one order", () => {// The panel lists enabled levels in canonical order; the save path must fall// back to the same first entry, or the user is shown one default and another// is persisted for a binding whose levels were toggled out of order.- const orderings = pickerSource.match(/sortThinkingLevels\(/g) ?? [];- assert.ok(orderings.length >= 3, `expected 3+ orderings, saw ${orderings.length}`);- assert.match(pickerSource, /: \(sortThinkingLevels\(next\)\[0\] \?\? null\)/);assert.match(pickerSource,/const thinkingLevels = sortThinkingLevels\(binding\.thinkingLevels\)/,);assert.match(pickerSource, /const enabled = thinkingLevels/);- assert.match(pickerSource, /: \(enabled\[0\] \?\? null\)/);+ assert.match(+ pickerSource,+ /resolveBindingDefaultThinkingLevel\(\s*binding\.defaultThinkingLevel,\s*enabled,/,+ );+ assert.match(+ pickerSource,+ /resolveBindingDefaultThinkingLevel\(\s*binding\.defaultThinkingLevel,\s*sortThinkingLevels\(next\),/,+ );});diff --git a/apps/desktop/test/models-dev-catalog.test.mjs b/apps/desktop/test/models-dev-catalog.test.mjsindex a2c72419c..352b0806f 100644--- a/apps/desktop/test/models-dev-catalog.test.mjs+++ b/apps/desktop/test/models-dev-catalog.test.mjs@@ -635,6 +635,23 @@ test("models.dev reasoning options map to canonical levels", () => {assert.deepEqual(thinkingLevelsFromModelsDev(false, [{ type: "effort", values: ["high"] }]), []);});+test("toggle ladders still map off to none", () => {+ const [provider] = parseModelsDevCatalog({+ vendor: {+ name: "Vendor",+ models: {+ "toggle-model": {+ id: "toggle-model",+ reasoning: true,+ reasoning_options: [{ type: "toggle" }],+ },+ },+ },+ });+ const info = modelInfoFromModelsDev(provider.models[0], "row");+ assert.equal(info.thinkingLevelMap?.off, "none");+});+test("the application loads the bundled release snapshot without network access", async () => {const dir = await mkdtemp(join(tmpdir(), "pi-models-dev-release-"));const catalogPath = join(dir, "api.json");diff --git a/crates/host-core/src/providers/catalog.rs b/crates/host-core/src/providers/catalog.rsindex 834f0042e..7437ca73f 100644--- a/crates/host-core/src/providers/catalog.rs+++ b/crates/host-core/src/providers/catalog.rs@@ -21,6 +21,13 @@ fn normalize_context_window_source(value: Option<&str>) -> Option<String> {.then_some(trimmed)}+fn default_thinking_level_allowed(level: &str, thinking_levels: &[String]) -> bool {+ if level == "omit" {+ return thinking_levels.iter().any(|item| item != "off");+ }+ thinking_levels.iter().any(|item| item == level)+}+pub(crate) fn normalize_model_bindings(bindings: &[ModelBinding]) -> Vec<ModelBinding> {bindings.iter()@@ -33,7 +40,8 @@ pub(crate) fn normalize_model_bindings(bindings: &[ModelBinding]) -> Vec<ModelBilet default_thinking_level = binding.default_thinking_level.as_deref()- .filter(|level| thinking_levels.iter().any(|item| item == level))+ .map(str::trim)+ .filter(|level| default_thinking_level_allowed(level, &thinking_levels)).map(str::to_string).or_else(|| thinking_levels.first().cloned());Some(ModelBinding {@@ -303,4 +311,20 @@ mod tests {assert_eq!(normalized[0].context_window, DEFAULT_CONTEXT_WINDOW);assert_eq!(normalized[0].max_tokens, DEFAULT_MAX_TOKENS);}++ #[test]+ fn omit_default_survives_on_reasoning_bindings_only() {+ let mut reasoning = binding("r", DEFAULT_CONTEXT_WINDOW);+ reasoning.thinking_levels = vec!["high".into(), "medium".into()];+ reasoning.default_thinking_level = Some("omit".into());+ let mut off_only = binding("plain", DEFAULT_CONTEXT_WINDOW);+ off_only.thinking_levels = vec!["off".into()];+ off_only.default_thinking_level = Some("omit".into());+ let normalized = normalize_model_bindings(&[reasoning, off_only]);+ assert_eq!(+ normalized[0].default_thinking_level.as_deref(),+ Some("omit")+ );+ assert_eq!(normalized[1].default_thinking_level.as_deref(), Some("off"));+ }}diff --git a/docs/adr/0295-session-thinking-parameter-omission.md b/docs/adr/0295-session-thinking-parameter-omission.mdindex 768617874..5c8a3f8a9 100644--- a/docs/adr/0295-session-thinking-parameter-omission.md+++ b/docs/adr/0295-session-thinking-parameter-omission.md@@ -29,6 +29,10 @@ Users need that third choice on the Composer model × reasoning menu.otherwise. Agent bookkeeping stays `off`; the parent stream uses the samelow-level omit path as subagents (`thinkingLevelMap.off = null`).4. Schema v19 rebuilds `sessions` so the CHECK includes `omit`. Handshake protocol version is unchanged.+5. Settings `defaultThinkingLevel` accepts `omit` when the binding enables any+ canonical reasoning level, so new sessions can start without a thinking+ override. Capability chips stay canonical; an off-only binding still+ rejects `omit`.## Consequences@@ -36,3 +40,4 @@ Users need that third choice on the Composer model × reasoning menu.control without disabling thinking.- Existing sessions keep their stored canonical levels.- Subagent inherit of a parent `omit` continues to omit.+- A reasoning model's Settings default can be `omit`; new sessions inherit it.diff --git a/docs/spec/03-runtime/11-provider-model-system.md b/docs/spec/03-runtime/11-provider-model-system.mdindex 9c459f6cd..b39859f5a 100644--- a/docs/spec/03-runtime/11-provider-model-system.md+++ b/docs/spec/03-runtime/11-provider-model-system.md@@ -208,8 +208,9 @@ PI-Desktop must not permanently restrict users to a short fixed model list.8. Settings renders the seven canonical thinking levels for every binding.Published levels begin selected for a known reasoning model. A non-reasoningor unknown model shows the same choices unselected, with a short manual- override note. `defaultThinkingLevel` is chosen from the levels the binding- enables, so a stored default is always part of the explicit set.+ override note. `defaultThinkingLevel` is chosen from `omit` plus the levels+ the binding enables, so a stored default is either `omit` or part of that+ explicit set.9. `supportsImages` and `supportsDocuments` are three-state overrides. Absentor `null` follows the published models.dev modality, so a catalog correctionstill reaches a saved binding; `true` or `false` is the user's explicit@@ -324,7 +325,7 @@ type ModelBinding = {contextWindowSource?: "catalog" | "user"maxTokens: numberthinkingLevels: ThinkingLevel[]- defaultThinkingLevel: ThinkingLevel | null+ defaultThinkingLevel: SessionThinkingLevel | nullavailableForSubagents?: boolean // opt-in for AI-driven delegation}diff --git a/docs/spec/03-runtime/12-provider-config-schema.md b/docs/spec/03-runtime/12-provider-config-schema.mdindex 88d03815b..8df6e0928 100644--- a/docs/spec/03-runtime/12-provider-config-schema.md+++ b/docs/spec/03-runtime/12-provider-config-schema.md@@ -99,7 +99,7 @@ Tables (canonical DDL in [04-data-storage](04-data-storage.md) §4.3–4.4, §4.},"defaultThinkingLevel": {"type": ["string", "null"],- "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "max", null]+ "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "max", "omit", null]},"supportsImages": { "type": ["boolean", "null"] },"supportsDocuments": { "type": ["boolean", "null"] },diff --git a/docs/spec/03-runtime/13-model-catalog-and-selection.md b/docs/spec/03-runtime/13-model-catalog-and-selection.mdindex a149ea9cb..c77842ecc 100644--- a/docs/spec/03-runtime/13-model-catalog-and-selection.md+++ b/docs/spec/03-runtime/13-model-catalog-and-selection.md@@ -195,11 +195,11 @@ resolves to `off`.For a newly created session, the renderer resolves the selected (or app-default)model's `ModelBinding`. A reasoning model starts at that binding's-`defaultThinkingLevel`, clamped onto the enabled levels. When the default is-unset it falls back to the highest enabled level seeded from published-`supportedThinkingLevels`. A non-reasoning or unknown model starts at `off`-until the user enables a non-`off` level. This is a creation default only and-never rewrites an existing session's stored choice.+`defaultThinkingLevel` (`omit` is preserved; other values are clamped onto the+enabled levels). When the default is unset it falls back to the highest enabled+level seeded from published `supportedThinkingLevels`. A non-reasoning or+unknown model starts at `off` until the user enables a non-`off` level. This is+a creation default only and never rewrites an existing session's stored choice.Unpinned sessions still advertise that inherited default model's reasoningcapability on session list/get/create/fork/configure. Enrichment does not pindiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 3a3e219ca..259e811e4 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -11079,10 +11079,13 @@ are withdrawn with ADR 0165.reasoning option, followed by the binding's enabled canonical levels.2) Choose `omit` and confirm the chip shows `omit` and the session stores`thinkingLevel: omit`. 3) Send a turn and inspect the outbound request.- 4) Choose explicit `off` and send again.+ 4) Choose explicit `off` and send again. 5) In Settings → Model configuration,+ expand the same model's Advanced row and confirm the default picker lists+ `omit` first; save `omit` as the default and start a new session.- **Expected**: `omit` persists and the request has no thinking/reasoning field.Explicit `off` still serializes a disable. A non-reasoning model keeps an- `off`-only menu.+ `off`-only menu. A new session whose binding default is `omit` starts at+ `omit`.- **Specs linked**: `03-runtime/01-ipc-protocol.md`,`03-runtime/02-agent-runtime.md`, `03-runtime/13-model-catalog-and-selection.md`,ADR 0295 / D456diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex be01d8a76..38c87c204 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -173,7 +173,7 @@ Gold source: local Codex electron captures; latest row wins where rows conflict.| D168 | Project archive presentation redesign | *(band layout and per-section panels superseded by D267)* **Project archive renders three stacked bands: an overview banner (intent sentence, primary Add project, and four derived counters for projects, open, archived, sessions), a toolbar (search with clear affordance and live match count, plus a Recent/Name sort segmented control), and a grouped index whose always-visible sections run Pinned / All projects / Archived with per-section counts, one settings panel per section, and hairline row separators. Rows carry a disclosure control, glyph, name with Active/Open/pinned/Archived tags, one meta line (shortened monospace path, branch, session count), relative last-active time, and hover/focus-revealed New task plus row menu; the menu groups create/edit above pin, archive/restore, and destructive Close, and dismisses on Escape or outside press. Archived rows are grouped and softened, never hidden or filtered, so D133's no-visibility-toggle rule still holds. This supersedes D133's flat-list presentation without changing project storage, search matching, session batching, or activation semantics.** | The flat single-list archive gave equal weight to pinned, working, and archived records and hid its disclosure and row actions behind hover, so scanning a long durable index meant reading every row. Grouping with derived counters and an explicit sort makes state legible at a glance while keeping archived history permanently reachable. || D267 | Project archive is one workbench, not three bands | *(row anatomy and inline expansion superseded by D455)* **Revise D168's band layout: Settings → Project archive renders the D257 one-workbench composition — a quiet intro line carrying only the page description, one toolbar (Recent/Name sort on the shared `settings-segment` primitive, search with clear affordance and live match count, primary Add project), and one settings panel whose always-visible Pinned / All projects / Archived groups are non-interactive in-panel header strips with per-section counts instead of one panel per section. The decorative gradient hero band is removed together with the four page-level overview counters it carried, retiring the `project.statProjects`, `project.statOpen`, `project.statArchived`, and `project.statSessions` keys; the per-group counts on the panel's header strips are now the only totals. The external uppercase section labels are removed as well; row geometry matches the capability rows (32px controls, 14px list gap, 28px row glyph). Beyond dropping the four retired counter keys this is presentation only: D168's row anatomy, row menu grouping, search matching, session batching, activation semantics, and accessibility semantics are unchanged, and no ADR is required.** | D168's overview banner used a decorative gradient and `--text-xl` counter tiles, which the design system forbids, and its per-section panels repeated the same elevated frame three times. Demoting the counters to an inline run kept the clutter without earning it: every total they showed is already legible from the per-group strip counts, so restating them above the toolbar duplicated numbers and gave the destination a header no sibling page has. Dropping them leaves the durable index looking and behaving like the agent capability pages. || D455 | Project archive is a list + inspector | *(row anatomy superseded by the same-day "Project archive reads as an inset grouped card list" entry)* **Revise D267's expanding rows: Settings → Project archive keeps the quiet intro and toolbar, then a one-column workbench. The index remains Pinned / All projects / Archived with per-section counts and no visibility toggle (D133). Compact rows show glyph, name, one status tag, session count, and relative time. A click selects and stays in Settings; double-click, Enter, or the inspector Open action activates and returns to chat. Folders, chats (batches of eight), and the row menu open under the selected row at full width. Search still matches session titles and selects the owning project. Presentation only: no IPC, storage, or host change. See ADR 0294 and E2E-038.** | Inline expansion and per-row menus made a long durable index hard to scan, and clicking a name left Settings instead of managing the project. |-| D456 | Session thinking-parameter omission | **Amend ADR 0194 / ADR 0144 / ADR 0221: session `thinkingLevel` accepts `omit` in addition to the seven canonical levels. Composer prepends `omit` on a reasoning model. Runtime bookkeeping stays `off` and uses the low-level provider stream so no thinking override is synthesized. Binding/catalog capability lists stay canonical. Schema v19 widens the session CHECK to include `omit`. Handshake protocol version is unchanged. See ADR 0295 and E2E-203a.** | Explicit `off` still serializes a disable; users need a session-level do-not-send matching subagents. |+| D456 | Session thinking-parameter omission | **Amend ADR 0194 / ADR 0144 / ADR 0221: session `thinkingLevel` accepts `omit` in addition to the seven canonical levels. Composer prepends `omit` on a reasoning model. Settings `defaultThinkingLevel` also accepts `omit` when the binding enables any reasoning level. Runtime bookkeeping stays `off` and uses the low-level provider stream so no thinking override is synthesized. Binding/catalog capability lists stay canonical. Schema v19 widens the session CHECK to include `omit`. Handshake protocol version is unchanged. See ADR 0295 and E2E-203a.** | Explicit `off` still serializes a disable; users need a session-level do-not-send matching subagents. |## E. M5 hardening decisions (0.4.0)@@ -6256,6 +6256,8 @@ that was sitting at the bottom — including after the turn had finished.so adapters send no thinking field. Explicit `off` still disables thinking.- The Composer reasoning menu prepends `omit` whenever the selected modelexposes enabled canonical levels, and the chip renders the canonical string.+ Settings `defaultThinkingLevel` also accepts `omit` on a reasoning binding+ so new sessions can start without a thinking override.Schema v19 rebuilds `sessions` so the CHECK includes `omit`.See ADR 0295 and E2E-203a.diff --git a/docs/zh-CN/spec/03-runtime/11-provider-model-system.md b/docs/zh-CN/spec/03-runtime/11-provider-model-system.mdindex 681f8dd73..3fcb58964 100644--- a/docs/zh-CN/spec/03-runtime/11-provider-model-system.md+++ b/docs/zh-CN/spec/03-runtime/11-provider-model-system.md@@ -189,8 +189,10 @@ PI-Desktop 不得把用户永久限制在一份简短的固定模型列表上。sidecar 与上下文检查器仍处在同一个有效窗口上。8. 设置为每个 binding 渲染七个规范思考级别。对已知的推理模型,已发布的级别一开始就是选中的。非推理或未知模型显示同样的选项但不选中,并附一行简短的- 手动覆盖说明。`defaultThinkingLevel` 从该 binding 已启用的级别中选取,- 因此存下来的默认值始终属于那个显式集合。+ 手动覆盖说明。`defaultThinkingLevel` 从 `omit` 加上该 binding 已启用的级别+ 中选取,因此存下来的默认值要么是 `omit`,要么属于那个显式集合。+PUT 296.=296:+ defaultThinkingLevel: SessionThinkingLevel | null9. `supportsImages` 与 `supportsDocuments` 是三态覆盖。缺省或 `null` 表示跟随已发布的 models.dev 模态,因此目录的更正仍然能作用到已保存的 binding;`true` 或 `false` 是用户的显式回答,并在目录变动后继续有效。与思考级别@@ -293,7 +295,7 @@ type ModelBinding = {contextWindowSource?: "catalog" | "user"maxTokens: numberthinkingLevels: ThinkingLevel[]- defaultThinkingLevel: ThinkingLevel | null+ defaultThinkingLevel: SessionThinkingLevel | nullavailableForSubagents?: boolean // opt-in for AI-driven delegation}diff --git a/docs/zh-CN/spec/03-runtime/12-provider-config-schema.md b/docs/zh-CN/spec/03-runtime/12-provider-config-schema.mdindex a303d6322..9b3bebb6c 100644--- a/docs/zh-CN/spec/03-runtime/12-provider-config-schema.md+++ b/docs/zh-CN/spec/03-runtime/12-provider-config-schema.md@@ -96,7 +96,7 @@},"defaultThinkingLevel": {"type": ["string", "null"],- "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "max", null]+ "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "max", "omit", null]},"supportsImages": { "type": ["boolean", "null"] },"supportsDocuments": { "type": ["boolean", "null"] },diff --git a/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.md b/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.mdindex d2afd1e75..b8e516a4a 100644--- a/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.md+++ b/docs/zh-CN/spec/03-runtime/13-model-catalog-and-selection.md@@ -112,10 +112,10 @@ type RecentModelRef = {且不发送思考覆盖。对于新创建的会话,渲染器会解析所选(或应用默认)模型的 `ModelBinding`。-具有推理能力的模型始于该绑定的 `defaultThinkingLevel`,并钳位到已启用档位;-当默认值未设置时,才回落到已发布 `supportedThinkingLevels` 中的最高已启用档。-非推理模型或缺失的能力元数据从 `off` 开始。这是一个仅创建时的默认值,绝不会-重写现有会话的存储选择。+具有推理能力的模型始于该绑定的 `defaultThinkingLevel`(`omit` 保留;其它值+钳位到已启用档位);当默认值未设置时,才回落到已发布+`supportedThinkingLevels` 中的最高已启用档。非推理模型或缺失的能力元数据从+`off` 开始。这是一个仅创建时的默认值,绝不会重写现有会话的存储选择。未固定的会话仍在 list/get/create/fork/configure 上展示该继承默认模型的推理能力;丰富步骤不会写入 `providerId`/`modelId`。当所选目录/绑定模型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 ff6c2155f..398f8596c 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@@ -6973,8 +6973,8 @@ IPC 请求无法关闭。#### E2E-203a:会话思考 omit 不发送提供商覆盖- **前提条件**:Composer 已选中支持推理的已配置模型。-- **步骤**:1) 打开模型 × 推理菜单,确认 `omit` 是第一项,其后是绑定已启用的规范档位。2) 选择 `omit`,确认芯片显示 `omit` 且会话存 `thinkingLevel: omit`。3) 发送一回合并检查出站请求。4) 再选显式 `off` 并发送。-- **预期**:`omit` 会持久化,且请求不含思考/推理字段。显式 `off` 仍序列化为关闭思考。非推理模型菜单仍只有 `off`。+- **步骤**:1) 打开模型 × 推理菜单,确认 `omit` 是第一项,其后是绑定已启用的规范档位。2) 选择 `omit`,确认芯片显示 `omit` 且会话存 `thinkingLevel: omit`。3) 发送一回合并检查出站请求。4) 再选显式 `off` 并发送。5) 在设置 → 模型配置展开同一模型高级区,确认默认选择器把 `omit` 放在最前;把默认存成 `omit` 并开新会话。+- **预期**:`omit` 会持久化,且请求不含思考/推理字段。显式 `off` 仍序列化为关闭思考。非推理模型菜单仍只有 `off`。绑定默认是 `omit` 的新会话从 `omit` 开始。- **链接规格**:`03-runtime/01-ipc-protocol.md`、`03-runtime/02-agent-runtime.md`、`03-runtime/13-model-catalog-and-selection.md`、ADR 0295 / D456- **验收**:C + 质量- **里程碑**:M6+diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex b0c3d7018..beed77906 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -176,7 +176,11 @@| D168 | 项目档案演示重新设计 | *(堆叠带布局与每部分面板被 D267 取代)* **项目存档呈现三个堆叠带:一个概述横幅(意图句、主要添加项目以及用于项目、打开、存档、会话的四个派生计数器)、一个工具栏(具有清晰的可见性和实时匹配计数的搜索,以及 Recent/Name 排序分段控件),以及一个分组索引,其始终可见的部分运行“固定/所有项目/存档”,每个部分计数、每个部分一个设置面板和细线行分隔符。行包含公开控件、字形、带有 Active/Open/pinned/Archived 标签的名称、一条元行(缩短的等宽路径、分支、会话计数)、相对最后活动时间和 hover/focus-revealed 新任务加行菜单;菜单将 create/edit 置于引脚上方、archive/restore 和破坏性关闭中,并在 Escape 或外部按下时关闭。存档的行被分组和软化,从不隐藏或过滤,因此 D133 的不可见性切换规则仍然有效。这取代了 D133 的平面列表演示,而无需更改项目存储、搜索匹配、会话批处理或激活语义。** | 平面单列表存档对固定、工作和存档记录给予同等重视,并将其披露和行操作隐藏在悬停后面,因此扫描长期持久索引意味着读取每一行。使用派生计数器进行分组并进行显式排序,使状态一目了然,同时保持存档历史记录永久可访问。 || D267 | 项目存档是一个工作台,而不是三个堆叠带 | *(行剖析与行内展开被 D455 取代)* **修订 D168 的堆叠带布局:设置 → 项目存档改为呈现 D257 的一个工作台构成 —— 一条仅承载页面说明的安静引导行、一个工具栏(使用共享 `settings-segment` 基元的“最近/名称”排序、带清除可供性与实时匹配计数的搜索、主要“添加项目”),以及一个设置面板,其始终可见的固定/所有项目/存档分组是面板内带每部分计数的非交互标题条,而不是每部分一个面板。装饰渐变英雄带被移除,它承载的四个页面级概览计数器也一并移除,并停用 `project.statProjects`、`project.statOpen`、`project.statArchived` 和 `project.statSessions` 键;面板标题条上的分组计数现在是唯一的总计。外部大写部分标签也被移除;行几何与能力页面行一致(32px 控件、14px 列表间距、28px 行字形)。除停用上述四个计数器键外,其余仅为演示层变更:D168 的行剖析、行菜单分组、搜索匹配、会话批处理、激活语义和无障碍语义均不变,且不需要新的 ADR。** | D168 的概述横幅使用了装饰渐变和 `--text-xl` 计数器格,而设计系统明确禁止两者,且其每部分面板把同一个高架框重复了三次。把计数器降级为内联串只是保留了杂乱而没有换来价值:它们展示的每个总计都已能从分组条计数中读出,因此在工具栏上方重述这些数字既重复了数字,也让该目的地拥有了兄弟页面都没有的页头。移除它们后,持久索引在外观和行为上都与智能体能力页面一致。 || D455 | 项目存档改为列表 + 检查器 | *(行剖析被同日的「项目档案呈现为内嵌分组卡片列表」条目取代)* **修订 D267 的展开行:设置 → 项目存档保留安静引导行和工具栏,随后是单列工作台。索引仍按已置顶 / 全部项目 / 已归档分组并显示计数,且没有可见性开关(D133)。精简行显示字形、名称、一个状态标签、会话计数和相对时间。单击选中并留在设置页;双击、Enter 或检查器的打开操作激活项目并返回聊天。文件夹、对话(每批 8 条)和行菜单在选中行下方铺满宽度打开。搜索仍匹配会话标题并选中所属项目。仅演示层:无 IPC、存储或宿主改动。见 ADR 0294 与 E2E-038。** | 行内展开和行菜单让长索引难以扫读,单击名称还会离开设置页,不利于管理。 |-| D456 | 会话思考参数不发送 | **修订 ADR 0194 / ADR 0144 / ADR 0221:会话 `thinkingLevel` 在七个规范档位之外接受 `omit`。Composer 在推理模型上把 `omit` 放在菜单最前。运行时记账仍为 `off`,走低层 provider 流,不合成思考覆盖。绑定/目录能力列表保持规范档位。Schema v19 把会话 CHECK 扩到包含 `omit`。握手协议版本不变。见 ADR 0295 与 E2E-203a。** | 显式 `off` 仍会序列化为关闭思考;用户需要与子智能体一致的会话级不发送。 |+| D456 | 会话思考参数不发送 | **修订 ADR 0194 / ADR 0144 / ADR 0221:会话 `thinkingLevel` 在七个规范档位之外接受 `omit`。Composer 在推理模型上把 `omit` 放在菜单最前。设置页 `defaultThinkingLevel` 在绑定启用任一推理档时也接受 `omit`。运行时记账仍为 `off`,走低层 provider 流,不合成思考覆盖。绑定/目录能力列表保持规范档位。Schema v19 把会话 CHECK 扩到包含 `omit`。握手协议版本不变。见 ADR 0295 与 E2E-203a。** | 显式 `off` 仍会序列化为关闭思考;用户需要与子智能体一致的会话级不发送。 |+PUT 4493.=4494:+- Composer 推理菜单在所选模型有已启用规范档位时把 `omit` 放在最前,芯片渲染+ 规范字符串。设置页推理绑定的 `defaultThinkingLevel` 也接受 `omit`,新会话+ 可以不发送思考覆盖。Schema v19 重建 `sessions` 以使 CHECK 包含 `omit`。见 ADR 0295 与 E2E-203a。## E.M5 强化决策 (0.4.0)@@ -4491,7 +4495,8 @@ that amendment are retired by ADR 0268; the upstream work-panel lifecycle stays.- 运行时钳位在推理模型上保留 `omit`。智能体记账仍为 `off`,父级流与子智能体共用低层 omit 路径,适配器不发送思考字段。显式 `off` 仍关闭思考。- Composer 推理菜单在所选模型有已启用规范档位时把 `omit` 放在最前,芯片渲染- 规范字符串。Schema v19 重建 `sessions` 以使 CHECK 包含 `omit`。见 ADR 0295 与 E2E-203a。+ 规范字符串。设置页推理绑定的 `defaultThinkingLevel` 也接受 `omit`,新会话+ 可以不发送思考覆盖。Schema v19 重建 `sessions` 以使 CHECK 包含 `omit`。见 ADR 0295 与 E2E-203a。## 2026-09-19 —— 丢弃 outbox 毒消息;接受投递回合内的 steering(D597)diff --git a/packages/shared/src/thinking-levels.test.ts b/packages/shared/src/thinking-levels.test.tsindex 35ef5d0ff..a81ebc0d9 100644--- a/packages/shared/src/thinking-levels.test.ts+++ b/packages/shared/src/thinking-levels.test.ts@@ -7,6 +7,8 @@ import {nearestSupportedThinkingLevel,publishedThinkingLevels,sessionThinkingMenuLevels,+ bindingDefaultThinkingMenuLevels,+ resolveBindingDefaultThinkingLevel,} from "./thinking-levels.js";describe("highestSupportedThinkingLevel", () => {@@ -123,4 +125,26 @@ describe("session thinking omit", () => {expect(canonicalThinkingLevel("omit")).toBe("off");expect(canonicalThinkingLevel("high")).toBe("high");});++ it("offers omit as a Settings default on a reasoning binding", () => {+ expect(bindingDefaultThinkingMenuLevels(["low", "high"])).toEqual(["omit", "low", "high"]);+ expect(bindingDefaultThinkingMenuLevels(["high"])).toEqual(["omit", "high"]);+ expect(bindingDefaultThinkingMenuLevels(["off"])).toEqual(["off"]);+ expect(bindingDefaultThinkingMenuLevels([])).toEqual(["off"]);+ expect(resolveBindingDefaultThinkingLevel("omit", ["low", "high"])).toBe("omit");+ expect(resolveBindingDefaultThinkingLevel("omit", ["off"])).toBe("off");+ expect(resolveBindingDefaultThinkingLevel(null, ["low", "high"])).toBe("low");+ expect(+ initialThinkingLevelForBinding({+ thinkingLevels: ["low", "high"],+ defaultThinkingLevel: "omit",+ }),+ ).toBe("omit");+ expect(+ initialThinkingLevelForBinding({+ thinkingLevels: ["off"],+ defaultThinkingLevel: "omit",+ }),+ ).toBe("off");+ });});diff --git a/packages/shared/src/thinking-levels.ts b/packages/shared/src/thinking-levels.tsindex 989b5dc7f..9336b727a 100644--- a/packages/shared/src/thinking-levels.ts+++ b/packages/shared/src/thinking-levels.ts@@ -22,6 +22,32 @@ export function sessionThinkingMenuLevels(return ["omit", ...available];}+function enablesReasoning(levels: readonly ThinkingLevel[] | undefined): boolean {+ return Boolean(levels?.some((level) => level !== "off"));+}++/**+ * Settings default picker: `omit` first when the binding enables any+ * reasoning level. Capability chips stay canonical.+ */+export function bindingDefaultThinkingMenuLevels(+ enabled: readonly ThinkingLevel[] | undefined,+): SessionThinkingLevel[] {+ const levels = enabled?.length ? [...enabled] : [];+ if (!enablesReasoning(levels)) return levels.length > 0 ? levels : ["off"];+ return ["omit", ...levels];+}++/** Keep a stored default when it is still a legal picker value. */+export function resolveBindingDefaultThinkingLevel(+ stored: SessionThinkingLevel | null | undefined,+ enabled: readonly ThinkingLevel[] | undefined,+): SessionThinkingLevel | null {+ const choices = bindingDefaultThinkingMenuLevels(enabled);+ if (stored && choices.includes(stored)) return stored;+ return enabled?.[0] ?? null;+}+export function highestSupportedThinkingLevel(levels: readonly ThinkingLevel[] | undefined,): ThinkingLevel {@@ -36,7 +62,7 @@ export function highestSupportedThinkingLevel(/** Binding fields that seed a new draft or session thinking level. */export type ThinkingLevelBindingSource = {thinkingLevels?: readonly ThinkingLevel[] | null;- defaultThinkingLevel?: ThinkingLevel | null;+ defaultThinkingLevel?: SessionThinkingLevel | null;};/**@@ -65,17 +91,19 @@ export function nearestSupportedThinkingLevel(/*** Thinking level a new draft or session starts at for a model binding.*- * Prefer the stored default when it is still enabled; otherwise clamp that- * default onto the enabled ladder. With no stored default, fall back to the- * strongest enabled level so a reasoning model never starts at `off` merely- * because Settings has not picked a default yet.+ * Prefer the stored default when it is still enabled, including `omit` on a+ * reasoning binding. Otherwise clamp that default onto the enabled ladder.+ * With no stored default, fall back to the strongest enabled level so a+ * reasoning model never starts at `off` merely because Settings has not+ * picked a default yet.*/export function initialThinkingLevelForBinding(binding: ThinkingLevelBindingSource | null | undefined,fallbackLevels?: readonly ThinkingLevel[],-): ThinkingLevel {+): SessionThinkingLevel {const enabled = binding?.thinkingLevels ?? fallbackLevels;const stored = binding?.defaultThinkingLevel;+ if (stored === "omit") return enablesReasoning(enabled) ? "omit" : "off";if (stored != null) return nearestSupportedThinkingLevel(stored, enabled);return highestSupportedThinkingLevel(enabled);}diff --git a/packages/shared/src/types/models.ts b/packages/shared/src/types/models.tsindex 937e11a01..c91f044e1 100644--- a/packages/shared/src/types/models.ts+++ b/packages/shared/src/types/models.ts@@ -94,9 +94,9 @@ export type ModelBinding = {* `effectiveContextWindow`. */contextWindowSource?: ContextWindowSource;maxTokens: number;- /** Explicit endpoint levels; an empty or off-only set disables thinking. */thinkingLevels: ThinkingLevel[];- defaultThinkingLevel: ThinkingLevel | null;+ /** Canonical enabled level, or `omit` when new sessions should send no override. */+ defaultThinkingLevel: SessionThinkingLevel | null;/*** User override for image input. `null` or absent follows the published* models.dev capability; `true` forces image transport on for an endpoint the