Skip to content

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

fix(composer): coalesce reasoning slider commits and drop tick tab stops

vastsacc74faeceaf8
diff --git a/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx b/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx
index 613ac173b..e1dcd8c84 100644
--- a/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx
+++ b/apps/desktop/src/features/chat/composer/ComposerModelPicker.tsx
@@ -72,7 +72,6 @@ export function ComposerModelPicker({
modelSearchRef,
modelListRef,
thinkingListRef,
- thinkingSliderRef,
modelGroups,
flatModels,
thinkingMenuLevels,
@@ -92,13 +91,17 @@ export function ComposerModelPicker({
// Local drag lead: the native input follows the pointer or arrow key
// immediately while the store confirmation lands, so a controlled value
// never snaps back mid-drag. The lead clears once the store confirms.
+ const thinkingLevelsKey = thinkingMenuLevels.join("|");
const [dragThinkingIndex, setDragThinkingIndex] = useState<number | null>(null);
+ useEffect(() => {
+ setDragThinkingIndex(null);
+ }, [thinkingLevelsKey]);
useEffect(() => {
if (dragThinkingIndex === null) return;
if (thinkingMenuLevels[dragThinkingIndex] === thinkingLevel) {
setDragThinkingIndex(null);
}
- }, [dragThinkingIndex, thinkingLevel, thinkingMenuLevels]);
+ }, [dragThinkingIndex, thinkingLevel, thinkingLevelsKey, thinkingMenuLevels]);
const thinkingSliderValue = dragThinkingIndex ?? thinkingSliderIndex;
const thinkingSliderPercent =
thinkingMenuLevels.length > 1
@@ -184,7 +187,6 @@ export function ComposerModelPicker({
{thinkingMenuLevels.length > 1 ? (
<div className="composer-thinking-slider">
<input
- ref={thinkingSliderRef}
type="range"
className="composer-thinking-range"
min={0}
@@ -204,28 +206,23 @@ export function ComposerModelPicker({
const level = thinkingMenuLevels[index];
if (level && level !== thinkingLevel) void commitThinkingLevel(level);
}}
- onBlur={() => setDragThinkingIndex(null)}
onKeyDown={(event) => {
if (THINKING_SLIDER_KEYS.has(event.key)) event.stopPropagation();
}}
/>
- <div className="composer-thinking-ticks">
- {thinkingMenuLevels.map((level) => (
+ <div className="composer-thinking-ticks" aria-hidden="true">
+ {thinkingMenuLevels.map((level, index) => (
<button
key={level}
type="button"
- className={`composer-thinking-tick ${thinkingLevel === level ? "active" : ""}`}
- role="menuitemradio"
- aria-checked={thinkingLevel === level}
+ tabIndex={-1}
+ className={`composer-thinking-tick ${thinkingSliderValue === index ? "active" : ""}`}
title={level}
+ onMouseDown={(event) => event.preventDefault()}
onClick={() => {
+ setDragThinkingIndex(index);
if (level !== thinkingLevel) void commitThinkingLevel(level);
}}
- onKeyDown={(event) => {
- // Enter must commit this tick in place, not run the
- // menu's list selection.
- if (event.key === "Enter") event.stopPropagation();
- }}
>
{level}
</button>
diff --git a/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts b/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts
index 79c9787a4..e7d5895ec 100644
--- a/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts
+++ b/apps/desktop/src/features/chat/composer/hooks/useComposerModelMenu.ts
@@ -22,6 +22,7 @@ import {
thinkingProviderForModel,
type ComposerMenuView,
} from "../model";
+import { createLatestCommitQueue } from "./thinking-commit-queue";
type UseComposerModelMenuOptions = {
mode: Mode;
@@ -56,7 +57,42 @@ export function useComposerModelMenu({
const modelSearchRef = useRef<HTMLInputElement>(null);
const modelListRef = useRef<HTMLDivElement>(null);
const thinkingListRef = useRef<HTMLDivElement>(null);
- const thinkingSliderRef = useRef<HTMLInputElement>(null);
+ const thinkingConfigRef = useRef({
+ mode,
+ providerId: provider?.id,
+ modelId,
+ configureActiveSession,
+ showToast,
+ });
+ thinkingConfigRef.current = {
+ mode,
+ providerId: provider?.id,
+ modelId,
+ configureActiveSession,
+ showToast,
+ };
+ const thinkingQueueRef = useRef<ReturnType<typeof createLatestCommitQueue<SessionThinkingLevel>> | null>(
+ null,
+ );
+ if (!thinkingQueueRef.current) {
+ thinkingQueueRef.current = createLatestCommitQueue<SessionThinkingLevel>({
+ send: async (level) => {
+ const current = thinkingConfigRef.current;
+ await current.configureActiveSession({
+ mode: current.mode,
+ providerId: current.providerId,
+ modelId: current.modelId,
+ thinkingLevel: level,
+ });
+ },
+ onError: (error) => {
+ const current = thinkingConfigRef.current;
+ current.showToast(error instanceof Error ? error.message : String(error), {
+ variant: "error",
+ });
+ },
+ });
+ }
const thinkingProvider =
resolvedThinkingProvider ??
@@ -158,9 +194,14 @@ export function useComposerModelMenu({
setModelHighlight(-1);
setThinkingHighlight(-1);
}, [open]);
+ useEffect(() => {
+ thinkingQueueRef.current?.invalidate();
+ }, [activeSessionId, provider?.id, modelId]);
useEffect(() => {
- if (controlsBlocked) setOpen(false);
+ if (!controlsBlocked) return;
+ setOpen(false);
+ thinkingQueueRef.current?.invalidate();
}, [controlsBlocked]);
useEffect(() => {
@@ -204,6 +245,8 @@ export function useComposerModelMenu({
};
const selectModel = async (candidate: ProviderPublic, nextModelId: string) => {
+ thinkingQueueRef.current?.invalidate();
+ await thinkingQueueRef.current?.idle();
try {
const nextModelProvider = thinkingProviderForModel(
candidate,
@@ -237,40 +280,15 @@ export function useComposerModelMenu({
};
/**
- * Commit a reasoning level without leaving the menu surface, so a dragged
- * root slider or a tick click keeps the menu where it is. Returns false
- * when the configuration is rejected, mirroring the list selection path's
- * error contract.
- *
- * A drag can emit one commit per crossed stop. Idle sessions persist each
- * configure directly, so concurrent promises could resolve out of order and
- * land the store on a stale level. The chain serializes the sends: each
- * configure starts only after the previous one has settled its store write.
+ * Commit a reasoning level without leaving the menu surface. Latest-wins:
+ * a drag that crosses several stops only persists the last pending level
+ * after the in-flight write settles. Returns false when the configuration
+ * is rejected or invalidated by a session/model change.
*/
- const thinkingCommitChainRef = useRef<Promise<boolean | void>>(Promise.resolve());
- const commitThinkingLevel = async (level: SessionThinkingLevel) => {
- const send = async (): Promise<boolean> => {
- try {
- await configureActiveSession({
- mode,
- providerId: provider?.id,
- modelId,
- thinkingLevel: level,
- });
- return true;
- } catch (error) {
- showToast(error instanceof Error ? error.message : String(error), {
- variant: "error",
- });
- return false;
- }
- };
- const run = thinkingCommitChainRef.current.then(send);
- thinkingCommitChainRef.current = run.then(
- () => undefined,
- () => undefined,
- );
- return run;
+ const commitThinkingLevel = (level: SessionThinkingLevel) => {
+ const queue = thinkingQueueRef.current;
+ if (!queue) return Promise.resolve(false);
+ return queue.commit(level);
};
const selectThinkingLevel = async (level: SessionThinkingLevel) => {
@@ -342,7 +360,6 @@ export function useComposerModelMenu({
modelSearchRef,
modelListRef,
thinkingListRef,
- thinkingSliderRef,
modelGroups: filteredModelGroups,
flatModels,
thinkingMenuLevels,
diff --git a/apps/desktop/src/features/chat/composer/thinking-commit-queue.ts b/apps/desktop/src/features/chat/composer/thinking-commit-queue.ts
new file mode 100644
index 000000000..e497b3750
--- /dev/null
+++ b/apps/desktop/src/features/chat/composer/thinking-commit-queue.ts
@@ -0,0 +1,77 @@
+/**
+ * Latest-wins serial queue for composer thinking-level commits.
+ *
+ * A drag can cross several stops before an idle-session persist returns.
+ * Only the newest pending value is sent after the in-flight write settles.
+ * `invalidate` drops pending work so a model or session change cannot land
+ * a stale level on the wrong binding.
+ */
+export function createLatestCommitQueue<T>(options: {
+ send: (value: T) => Promise<void>;
+ onError?: (error: unknown) => void;
+}): {
+ commit: (value: T) => Promise<boolean>;
+ invalidate: () => void;
+ idle: () => Promise<void>;
+} {
+ let pending: T | null = null;
+ let generation = 0;
+ let busy = false;
+ let tail: Promise<boolean> = Promise.resolve(true);
+
+ const invalidate = () => {
+ generation += 1;
+ pending = null;
+ };
+
+ const drain = async (): Promise<boolean> => {
+ busy = true;
+ try {
+ while (pending !== null) {
+ const gen = generation;
+ const value = pending;
+ pending = null;
+ if (gen !== generation) return false;
+ try {
+ await options.send(value);
+ } catch (error) {
+ generation += 1;
+ pending = null;
+ options.onError?.(error);
+ return false;
+ }
+ if (gen !== generation) return false;
+ }
+ return true;
+ } finally {
+ busy = false;
+ }
+ };
+
+ const commit = (value: T): Promise<boolean> => {
+ pending = value;
+ const enqueuedAt = generation;
+ const finish = async (run: Promise<boolean>) => {
+ const ok = await run;
+ return ok && generation === enqueuedAt;
+ };
+ if (!busy) {
+ const run = drain();
+ tail = run.then(
+ () => true,
+ () => true,
+ );
+ return finish(run);
+ }
+ const run = tail.then(drain, drain);
+ tail = run.then(
+ () => true,
+ () => true,
+ );
+ return finish(run);
+ };
+
+ const idle = () => tail.then(() => undefined);
+
+ return { commit, invalidate, idle };
+}
diff --git a/apps/desktop/src/styles/composer-menus.css b/apps/desktop/src/styles/composer-menus.css
index 22a698076..00cce9b8d 100644
--- a/apps/desktop/src/styles/composer-menus.css
+++ b/apps/desktop/src/styles/composer-menus.css
@@ -295,10 +295,9 @@
border-radius: var(--radius-full);
background: var(--ds-accent);
}
-
.composer-thinking-range::-moz-range-thumb {
- width: 10px;
- height: 10px;
+ width: 14px;
+ height: 14px;
border: 2px solid var(--ds-bg-elevated-opaque);
border-radius: var(--radius-full);
background: var(--ds-accent);
diff --git a/apps/desktop/test/composer-model-thinking-menu.test.mjs b/apps/desktop/test/composer-model-thinking-menu.test.mjs
index 43dac4049..fa66c251f 100644
--- a/apps/desktop/test/composer-model-thinking-menu.test.mjs
+++ b/apps/desktop/test/composer-model-thinking-menu.test.mjs
@@ -39,22 +39,21 @@ test("the menu root carries the reasoning slider under the reasoning entry", ()
assert.match(composerSource, /className="composer-thinking-range"/);
assert.match(composerSource, /aria-label=\{t\("chat.reasoningLevel"\)\}/);
assert.match(composerSource, /aria-valuetext=\{thinkingMenuLevels\[thinkingSliderValue\] \?\? thinkingLevel\}/);
- assert.match(composerSource, /const commitThinkingLevel = async/);
+ assert.match(composerSource, /const commitThinkingLevel = /);
assert.match(composerSource, /if \(!\(await commitThinkingLevel\(level\)\)\) return;/);
assert.match(composerSource, /if \(level && level !== thinkingLevel\) void commitThinkingLevel\(level\);/);
- // The slider owns its arrow/Home/End keys so they adjust the level
- // instead of driving the menu's list navigation.
assert.match(composerSource, /if \(THINKING_SLIDER_KEYS\.has\(event\.key\)\) event\.stopPropagation\(\);/);
assert.match(composerSource, /composer-thinking-tick/);
- // A drag can emit one commit per crossed stop; sends serialize so
- // out-of-order configure responses cannot land a stale level.
- assert.match(composerSource, /thinkingCommitChainRef/);
+ assert.match(composerSource, /createLatestCommitQueue/);
+ assert.match(composerSource, /thinkingQueueRef\.current\?\.invalidate\(\)/);
+ assert.match(pickerSource, /tabIndex=\{-1\}/);
+ assert.match(pickerSource, /className="composer-thinking-ticks" aria-hidden="true"/);
+ assert.doesNotMatch(pickerSource, /composer-thinking-tick[\s\S]{0,200}role="menuitemradio"/);
assert.match(stylesSource, /\.composer-thinking-range::-webkit-slider-runnable-track/);
assert.match(stylesSource, /\.composer-thinking-range::-webkit-slider-thumb/);
assert.match(stylesSource, /\.composer-thinking-range::-moz-range-thumb/);
assert.match(stylesSource, /\.composer-thinking-tick\.active\s*\{/);
- // The slider/list toggle machinery is gone: one surface, one behavior.
- assert.doesNotMatch(composerSource, /thinkingMode|showThinkingMode|ThinkingSelectionMode/);
+ assert.doesNotMatch(composerSource, /thinkingMode|showThinkingMode|ThinkingSelectionMode|thinkingCommitChainRef/);
});
test("opening the combined menu preloads model metadata before its submenu", () => {
diff --git a/apps/desktop/test/thinking-commit-queue.test.mjs b/apps/desktop/test/thinking-commit-queue.test.mjs
new file mode 100644
index 000000000..acb7fe4af
--- /dev/null
+++ b/apps/desktop/test/thinking-commit-queue.test.mjs
@@ -0,0 +1,92 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { createLatestCommitQueue } from "../src/features/chat/composer/thinking-commit-queue.ts";
+
+test("latest-wins drops values that arrive while a send is in flight", async () => {
+ const sent = [];
+ let releaseFirst;
+ const firstGate = new Promise((resolve) => {
+ releaseFirst = resolve;
+ });
+ const queue = createLatestCommitQueue({
+ send: async (value) => {
+ sent.push(value);
+ if (sent.length === 1) await firstGate;
+ },
+ });
+
+ const first = queue.commit("low");
+ const middle = queue.commit("medium");
+ const last = queue.commit("high");
+ releaseFirst();
+ assert.equal(await first, true);
+ assert.equal(await middle, true);
+ assert.equal(await last, true);
+ assert.deepEqual(sent, ["low", "high"]);
+});
+
+test("invalidate drops pending work and fails the in-flight waiter", async () => {
+ const sent = [];
+ let releaseFirst;
+ const firstGate = new Promise((resolve) => {
+ releaseFirst = resolve;
+ });
+ const queue = createLatestCommitQueue({
+ send: async (value) => {
+ sent.push(value);
+ if (sent.length === 1) await firstGate;
+ },
+ });
+
+ const first = queue.commit("low");
+ void queue.commit("medium");
+ queue.invalidate();
+ releaseFirst();
+ assert.equal(await first, false);
+ await queue.idle();
+ assert.deepEqual(sent, ["low"]);
+});
+
+test("a commit after invalidate is sent once the previous write settles", async () => {
+ const sent = [];
+ let releaseFirst;
+ const firstGate = new Promise((resolve) => {
+ releaseFirst = resolve;
+ });
+ const queue = createLatestCommitQueue({
+ send: async (value) => {
+ sent.push(value);
+ if (value === "low") await firstGate;
+ },
+ });
+
+ const first = queue.commit("low");
+ queue.invalidate();
+ const next = queue.commit("high");
+ releaseFirst();
+ assert.equal(await first, false);
+ assert.equal(await next, true);
+ assert.deepEqual(sent, ["low", "high"]);
+});
+
+test("send errors toast once and do not flush a newer pending value", async () => {
+ const sent = [];
+ const errors = [];
+ const queue = createLatestCommitQueue({
+ send: async (value) => {
+ sent.push(value);
+ throw new Error(`fail ${value}`);
+ },
+ onError: (error) => {
+ errors.push(error instanceof Error ? error.message : String(error));
+ },
+ });
+
+ const first = queue.commit("low");
+ const second = queue.commit("high");
+ assert.equal(await first, false);
+ assert.equal(await second, false);
+ assert.deepEqual(sent, ["low"]);
+ assert.deepEqual(errors, ["fail low"]);
+});
diff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.md
index b6509a3f0..fed2ab379 100644
--- a/docs/spec/04-ux/07-ui-design-system.md
+++ b/docs/spec/04-ux/07-ui-design-system.md
@@ -922,16 +922,18 @@ The composer renders only controls connected to the active pi session:
trigger shows a Bot icon, the current model, and reasoning level; `off` omits
the level text. Its single `role="menu"`
popover opens above the trigger at `bottom: calc(100% + 8px)` and starts with
- exactly two current-value entries. When the binding enables more than one
- level, a drag slider across the selected provider's real
- `supportedThinkingLevels` sits directly beneath the Reasoning level entry;
- slider and tick commits apply without leaving the root. Each entry replaces
+ exactly two current-value entries. When the menu lists more than one
+ level (`omit` plus the binding's enabled canonical levels), a drag slider
+ sits directly beneath the Reasoning level entry; slider and tick commits
+ apply without leaving the root. Tick labels are not tab stops — the range
+ input is the accessible control. Each entry replaces
the menu contents in-place with a back row and its submenu. The Model
submenu contains search plus sticky provider groups. Each model row begins
at one tab stop beneath its provider heading, making the provider → model
hierarchy legible without altering the model label. The Reasoning submenu
- lists the enabled levels as radio rows with a selected-row check; selecting
- from the list returns to the root without dismissing the popover.
+ lists `omit` then the enabled levels as radio rows with a selected-row
+ check; selecting from the list returns to the root without dismissing the
+ popover.
- While the active session is running, the draft and runtime controls stay
editable as next-turn choices; only Send is disabled. Host configuration
remains pinned for the in-flight turn and the latest queued choice is
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 1a9a7bf8f..39de02222 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -2726,8 +2726,9 @@ reasoning-level control.
alias with the wire ID or a second visible name.
- The combined model × reasoning menu opens at `bottom: calc(100% + 8px)` with
`role="menu"`. Its root has exactly two `role="menuitem"` entries and, when
- the binding enables more than one level, a drag slider with one labeled
- stop per enabled level directly beneath the Reasoning level entry (D458).
+ the menu lists more than one level, a drag slider with one labeled stop per
+ level directly beneath the Reasoning level entry (D458). Tick labels are
+ clickable but not tab stops; the range input is the accessible control.
The Model submenu has a search input and sticky provider headings, while
the Reasoning level submenu starts with `Current model <model> supports
these reasoning levels` and lists `omit` then the selected model binding's
@@ -2740,8 +2741,8 @@ reasoning-level control.
trailing check. Selecting a concrete model, or a level from the radio list,
persists the complete session config, clears model filtering, and returns
to the root without dismissing the menu; slider and tick commits persist
- the level while the menu stays where it is. Closing and reopening always
- starts at the root.
+ the last pending level while the menu stays where it is. Closing and
+ reopening always starts at the root.
- Unknown Custom/OpenAI-compatible models remain at `off` until the user
explicitly enables a level in Settings. The menu never auto-infers reasoning
support; after an explicit binding selection it renders the configured level.
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 0f6e1b432..967ace3cf 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -3063,15 +3063,16 @@ identify the platform validation still needed.
level text. The single anchored menu replaces its root
with an in-place back row and submenu, never opens tabs or a second popover,
and always reopens at the root. Model search filters sticky provider groups;
- reasoning levels come from the selected model binding's explicit binding
+ reasoning levels come from `omit` then the selected model binding's enabled
levels in canonical order. The root carries a drag slider with one labeled
stop per level directly beneath the Reasoning level entry when more than
- one level is enabled (a single-level binding hides the slider); slider and
- tick commits update the chip immediately while the menu stays at the root.
- The Reasoning level entry opens the radio list, which uses radio semantics,
- a trailing check, and the current model support note. Selecting either
- value immediately updates the chip and root value, clears model filtering,
- and keeps the menu open. A
+ one level is listed (a single-level binding hides the slider). Dragging
+ across several stops persists only the last pending level; tick labels are
+ not tab stops. Slider and tick commits update the chip immediately while
+ the menu stays at the root. The Reasoning level entry opens the radio list,
+ which uses radio semantics, a trailing check, and the current model support
+ note. Selecting either value immediately updates the chip and root value,
+ clears model filtering, and keeps the menu open. A
non-reasoning or unknown model starts at `off`, but an explicit Settings
binding can make its configured levels available; discovery never promotes it
automatically. Refreshing discovered model data cannot overwrite the binding.
@@ -3084,7 +3085,7 @@ identify the platform validation still needed.
`03-runtime/13-model-catalog-and-selection.md`, ADR 0018, ADR 0027
- **Acceptance**: B (model config), Quality
- **Milestone**: M5
-- **Status**: Unit-covered (`thinking-ui.test.mjs`, `composer-model-thinking-menu.test.mjs`, agent-runtime capability tests); full UI scenario Draft
+- **Status**: Unit-covered (`thinking-ui.test.mjs`, `composer-model-thinking-menu.test.mjs`, `thinking-commit-queue.test.mjs`, agent-runtime capability tests); full UI scenario Draft
#### E2E-051: Thinking level persists with the session
diff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.md
index 2a55a1cd1..af28a38a4 100644
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@ -6336,10 +6336,12 @@ that was sitting at the bottom — including after the turn had finished.
Up/Down/Enter/Left contract, and root-return behavior.
- The slider owns its arrow/Home/End/Enter keys while focused, so those keys
adjust the level instead of driving menu navigation, while Escape still
- closes the menu. A drag can emit one commit per crossed stop, so commits
- serialize behind a promise chain and a local drag lead keeps the controlled
- input from snapping back while the store confirmation lands; a binding with
- a single enabled level hides the slider entirely.
+ closes the menu. Dragging across several stops keeps only the last pending
+ level; commits serialize latest-wins so an in-flight idle persist cannot
+ land an intermediate stop, and a session or model change invalidates
+ pending work. A local drag lead keeps the controlled input from snapping
+ back while the store confirmation lands. Tick labels are clickable but not
+ tab stops. A binding with a single enabled level hides the slider entirely.
- Level values remain untranslated canonical strings, including session
`omit` (D456) when the binding exposes enabled canonical levels. The
seven-level ladder, provider filtering, and clamping rules are unchanged.
diff --git a/docs/zh-CN/spec/04-ux/07-ui-design-system.md b/docs/zh-CN/spec/04-ux/07-ui-design-system.md
index 2d5fe79cc..657e3cc72 100644
--- a/docs/zh-CN/spec/04-ux/07-ui-design-system.md
+++ b/docs/zh-CN/spec/04-ux/07-ui-design-system.md
@@ -825,13 +825,7 @@ UTF-8 写入活动会话的临时 `pasted/` 目录,并在粘贴位置显示一
- 模型触发器仅显示活动模型 ID。它的菜单选择一个
为活动会话配置 provider/default-model 对并链接到
Agent。
-- 具有推理能力的模型会立即向您公开单独的思维触发器
- 左侧工具栏组中 Agent / Plan / Goal 的右侧。触发器显示
- 当前级别并打开模型的真实 `supportedThinkingLevels` 作为
- 紧凑的单列列表,并选中所选行。菜单适合它
- 内容、上限为 160px 和可用视口宽度,并截断标签
- 超过该上限。它仅包含具体的支持级别,没有
- inherit/default 行;没有推理支持的模型不会渲染任何触发器。
+- 右侧工具栏在独立的提示词增强 Sparkles 动作和发送/中止之前暴露一个组合的模型 × 推理触发器。触发器显示 Bot 图标、当前模型和推理等级;`off` 省略等级文本。其单个 `role="menu"` 弹出层在触发器上方 `bottom: calc(100% + 8px)` 打开,根层正好两条当前值条目。当菜单列出一个以上等级(`omit` 加上绑定已启用的规范档位)时,推理等级条目正下方放一条拖动滑杆;滑杆和刻度提交不离开根层。刻度标签不是 Tab 停靠点——可访问控件是 range 输入。每条条目把菜单内容原地替换成返回行和子菜单。模型子菜单包含搜索和粘性提供商分组。每个模型行从提供商标题下的一个 Tab 停靠点开始。推理子菜单把 `omit` 然后已启用档位列为带勾选的单选行;从列表选择后返回根层且不关闭弹出层。
- 当活动会话运行时,草稿和运行时控件保持不变
可编辑为下一轮选择;仅发送被禁用。主机配置
仍然固定在飞行中的回合处,最新的排队选择是
diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.md
index 8431c47f4..09d30d7f2 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -1970,15 +1970,7 @@ MainChat 底部的输入区域,用于撰写和发送提示。支持多行输
发现不可用时仍显示已配置的模型 ID。
- 打开组合菜单时,会在进入“模型”子菜单前开始加载模型。首个可见行使用缓存元数据或
已配置绑定;实时发现会在后台更新列表,不会把已配置别名替换成 wire ID 或第二个可见名称。
-- 对于具有推理能力的主动模型,会出现单独的思维触发器
- 紧邻模式芯片的右侧、许可之前
- 控制。它显示当前级别并仅打开支持的确切模型
- 紧凑的单列列表和规范顺序中的级别;选定的行
- 带有尾随支票。菜单宽度适合其内容最多 160 像素,并且
- 进一步受到视口的限制;较长的规范值会被截断。的
- 列表不包含 inherited/default 选择。等级使用规范值原样显示,不使用本地化标签;选择具体级别仍然存在
-完整的会话配置并关闭菜单。非推理模型渲染
- 没有思维触发。
+- 组合的模型 × 推理菜单在 `bottom: calc(100% + 8px)` 以 `role="menu"` 打开。根层正好两条 `role="menuitem"` 条目;当菜单列出一个以上等级时,推理等级条目正下方有一条每个等级一个刻度的拖动滑杆(D458)。刻度标签可点但不是 Tab 停靠点,range 输入才是可访问控件。模型子菜单有搜索输入和粘性提供商标题;推理等级子菜单以 `Current model <model> supports these reasoning levels` 开头,先列出 `omit` 再列出绑定已启用档位的经典单选行。`omit` 作为会话思考等级持久化,且不发送提供商思考覆盖(ADR 0295)。行使用 `role="menuitemradio"`、`aria-checked`、当前行样式和末尾勾选。从列表选择具体模型或等级会持久化完整会话配置、清除模型过滤并返回根层且不关闭菜单;滑杆和刻度提交最后一次待提交的档位并留在原地。关闭再打开总是从根层开始。
- 未知的 Custom/OpenAI-compatible 模型可以启用显式推理
从模型菜单覆盖。提供商刷新,会话选择
支持的级别最接近 `medium`,并出现工具栏触发器;已知的
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.md
index fa521a609..aea1b295f 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
@@ -1848,30 +1848,17 @@ hover/focus 不带移位标签,项目标题 hover/focus 路径显示
- **状态**:单位覆盖(`rpc::tests` 表示项目绑定、临时和
缺少会话工作区解决方案);完整的多回合UI场景草稿
-#### E2E-050:思考选择器遵循精确的模型功能
-
-- **先决条件**:一种编目推理模型,一种非推理模型,
- 以及一个未知的自由格式模型 ID。
-- **步骤**: 1) 依次选择每个 provider/model。 2)检查输入框
- Agent / Plan / Goal 旁边的控件。 3)打开Thinking触发器并选择多个
- 支持的级别。 4) 检查未知模型的​​菜单和提供商设置。
-- **预期**:推理模型立即显示当前的思维水平
- Agent / Plan / Goal 的右侧,仅将其稀疏支持级别公开为
- 按规范顺序的单列列表,用尾随标记所选行
- 检查,不公开 inherit/default 行,调整菜单大小以适应其内容,而无需
- 超过 160px 或可用视口,截断过长标签并关闭
- 选择后的菜单。非推理模型不显示思维触发器。
- 每个级别都来自 pi 选择的模型记录。未知模型曝光
- 既不是思维触发器,也不是启用思维行动,并且提供商
- 设置不公开 reasoning/level 覆盖。刷新发现的模型
- 数据无法取代 pi 的已知模型语义或为 pi 发明功能
- 未知模型。
+#### E2E-050:Composer 模型 × 推理菜单遵循精确能力
+
+- **先决条件**:一种编目推理模型、一种非推理模型,以及一个未知的自由格式模型 ID。
+- **步骤**:1) 打开 Composer 模型 × 推理芯片。2) 确认根层包含带当前值的模型和推理等级条目,以及推理等级条目正下方每个支持等级一个刻度的滑杆。3) 拖动并点击滑杆跨过多档,再点击一个刻度标签,确认芯片更新且菜单留在根层。4) 打开模型,搜索并从一个提供商分组选择模型;确认菜单仍在根层打开。5) 打开推理等级并从单选列表选择一档。6) 对非推理提供商和未知自由格式模型 ID 重复;练习 Escape、外部点击、上/下、Enter、左方向键和滑杆方向键。
+- **预期**:芯片在右侧工具栏,带 Bot 图标,位于独立提示词增强 Sparkles 动作和发送/中止之前;Off 省略等级文本。单个锚定菜单把根层原地替换成返回行和子菜单,从不打开标签页或第二个弹出层,再打开总是从根层开始。模型搜索过滤粘性提供商分组;推理等级来自 `omit` 然后绑定已启用档位的规范顺序。当列出一个以上等级时,根层在推理等级条目正下方承载拖动滑杆(单档绑定隐藏滑杆)。拖过多个刻度只持久化最后一次待提交的档位;刻度标签不是 Tab 停靠点。滑杆和刻度提交立即更新芯片且菜单留在根层。推理等级条目打开单选列表,使用单选语义、末尾勾选和当前模型支持说明。选择任一值立即更新芯片和根层值、清除模型过滤并保持菜单打开。非推理或未知模型从 `off` 开始,但显式 Settings 绑定可以提供其配置档位;发现不会自动提升。刷新发现的模型数据不能覆盖绑定。第一条消息创建会话之前,Composer 使用模型菜单里选中的精确模型而不是提供商默认模型;物化后仍保持同一精确模型能力。
- **链接规格**:`03-runtime/11-provider-model-system.md`,
`03-runtime/12-provider-config-schema.md`,
`03-runtime/13-model-catalog-and-selection.md`、ADR 0018、ADR 0027
- **验收**:B(模型配置),质量
- **里程碑**:M5
-- **状态**:单元覆盖(`thinking-ui.test.mjs`,代理运行时能力测试);完整的 UI 场景草稿
+- **状态**:单元覆盖(`thinking-ui.test.mjs`、`composer-model-thinking-menu.test.mjs`、`thinking-commit-queue.test.mjs`,代理运行时能力测试);完整 UI 场景草稿
#### E2E-051:思考水平在会话中持续存在
diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.md
index dcee6cf7b..ed876b9bc 100644
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@ -4539,5 +4539,5 @@ that amendment are retired by ADR 0268; the upstream work-panel lifecycle stays.
- Composer 的推理等级此前只能在一个子菜单里的竖向单选列表中切换。Issue #417 希望参考 Codex 桌面版做成滑动条,同时保留原有的「点击值标签进入下拉列表」交互。
- 合并后的「模型 × 推理」菜单根层现在直接展示一个原生 range 输入,每个已启用等级一个刻度,并配有可点击的刻度标签,位置就在「推理等级」条目正下方。拖动滑块或点击刻度都会通过同一条 `configureActiveSession` 路径立即提交等级,并停留在菜单原处,因此临时调整不必再往子菜单里跑一趟。「推理等级」条目本身仍然打开经典单选列表,保留其单选语义、末尾勾选、上/下/Enter/左键契约与返回根层的行为。
-- 滑块在获得焦点时自行掌管方向键/Home/End/Enter,因此这些按键用于调整等级而不再驱动菜单导航,Escape 仍然关闭菜单。一次拖动可能每穿过一个刻度就提交一次,因此提交串接在一条 promise 链上;同时用一个本地拖动前导值,避免受控输入在 store 确认回写之前被弹回。当绑定只启用了一个等级时,滑块整体隐藏。
+- 滑块在获得焦点时自行掌管方向键/Home/End/Enter,因此这些按键用于调整等级而不再驱动菜单导航,Escape 仍然关闭菜单。拖过多个刻度只保留最后一次待提交的档位,提交按 latest-wins 串行,空闲会话的持久化不会把中间档写进去;会话或模型变化会作废未完成的提交。本地拖动前导值避免受控输入在 store 确认回写之前被弹回。刻度标签可点但不进入 Tab 顺序。当菜单只列出一个等级时,滑块整体隐藏。
- 等级值仍是未翻译的规范字符串,在绑定暴露已启用规范档位时也包括会话级 `omit`(D456)。七级阶梯、提供方过滤与钳制规则均未改动;仅渲染层:无协议、存储、宿主、权限或迁移改动。见 `04-ux/08-component-spec.md`、`04-ux/07-ui-design-system.md` 与 E2E-050。