From eaa7f55c4af01177396994f768bb02a7bba9c2c6 Mon Sep 17 00:00:00 2001 From: murashit Date: Sun, 14 Jun 2026 21:41:34 +0900 Subject: [PATCH] Remove default from composer effort picker --- .../panel/surface/composer-projection.tsx | 23 +++++-------------- .../chat/panel/surface/create-surface.ts | 1 - src/features/chat/panel/surface/model.ts | 1 - tests/features/chat/panel/shell.test.tsx | 1 - .../chat/panel/surface/projection.test.ts | 17 ++------------ .../chat/panel/toolbar-archive-state.test.tsx | 1 - 6 files changed, 8 insertions(+), 36 deletions(-) diff --git a/src/features/chat/panel/surface/composer-projection.tsx b/src/features/chat/panel/surface/composer-projection.tsx index 05bce9d0..93d02f14 100644 --- a/src/features/chat/panel/surface/composer-projection.tsx +++ b/src/features/chat/panel/surface/composer-projection.tsx @@ -44,7 +44,6 @@ export interface RuntimeComposerChoicesInput { snapshot: RuntimeSnapshot; requestModel: (model: string) => void; requestReasoningEffort: (effort: ReasoningEffort) => void; - resetReasoningEffortToConfig: () => void; } export function composerPlaceholder(threadName: string | null): string { @@ -76,7 +75,6 @@ export function chatPanelComposerProjection( snapshot, requestModel: (model) => void surface.runtime.requestModel(model), requestReasoningEffort: (effort) => void surface.runtime.requestReasoningEffort(effort), - resetReasoningEffortToConfig: () => void surface.runtime.resetReasoningEffortToConfig(), }), }, }; @@ -150,22 +148,13 @@ export function runtimeComposerChoices(input: RuntimeComposerChoicesInput): { } const activeEffort = currentReasoningEffort(input.snapshot, config); - const effortChoices: ChatPanelComposerRuntimeChoice[] = [ - { - label: "Codex default", - selected: activeEffort === null, - onClick: () => { - input.resetReasoningEffortToConfig(); - }, + const effortChoices: ChatPanelComposerRuntimeChoice[] = supportedReasoningEfforts(input.snapshot, config).map((effort) => ({ + label: effort, + selected: activeEffort === effort, + onClick: () => { + input.requestReasoningEffort(effort); }, - ...supportedReasoningEfforts(input.snapshot, config).map((effort) => ({ - label: effort, - selected: activeEffort === effort, - onClick: () => { - input.requestReasoningEffort(effort); - }, - })), - ]; + })); return { modelChoices, effortChoices }; } diff --git a/src/features/chat/panel/surface/create-surface.ts b/src/features/chat/panel/surface/create-surface.ts index 02d1a61a..c3fba1e3 100644 --- a/src/features/chat/panel/surface/create-surface.ts +++ b/src/features/chat/panel/surface/create-surface.ts @@ -60,7 +60,6 @@ export function createChatPanelSurface(host: ChatPanelSurfaceHost, deps: ChatPan runtime: { requestModel: (model) => deps.runtimeSettings.requestModelFromUi(model), requestReasoningEffort: (effort) => deps.runtimeSettings.requestReasoningEffortFromUi(effort), - resetReasoningEffortToConfig: () => deps.runtimeSettings.resetReasoningEffortToConfigFromUi(), }, }, }; diff --git a/src/features/chat/panel/surface/model.ts b/src/features/chat/panel/surface/model.ts index f328409e..32dde0ab 100644 --- a/src/features/chat/panel/surface/model.ts +++ b/src/features/chat/panel/surface/model.ts @@ -81,7 +81,6 @@ export interface ChatPanelComposerSurface { runtime: { requestModel: (model: string) => Promise; requestReasoningEffort: (effort: ReasoningEffort) => Promise; - resetReasoningEffortToConfig: () => Promise; }; } diff --git a/tests/features/chat/panel/shell.test.tsx b/tests/features/chat/panel/shell.test.tsx index d3c7165e..fe091d0f 100644 --- a/tests/features/chat/panel/shell.test.tsx +++ b/tests/features/chat/panel/shell.test.tsx @@ -450,7 +450,6 @@ function surfaceFixture(options: { toolbarConnected?: () => boolean } = {}): Cha runtime: { requestModel: async () => undefined, requestReasoningEffort: async () => undefined, - resetReasoningEffortToConfig: async () => undefined, }, }, }; diff --git a/tests/features/chat/panel/surface/projection.test.ts b/tests/features/chat/panel/surface/projection.test.ts index 97577939..fee6da7e 100644 --- a/tests/features/chat/panel/surface/projection.test.ts +++ b/tests/features/chat/panel/surface/projection.test.ts @@ -225,7 +225,6 @@ describe("chat panel surface projections", () => { state.connection.availableModels = [modelFixture("gpt-5.5"), modelFixture("gpt-5-mini")]; const selectedModels: string[] = []; const selectedEfforts: string[] = []; - let resetEffortCount = 0; const choices = runtimeComposerChoices({ state, @@ -236,25 +235,17 @@ describe("chat panel surface projections", () => { requestReasoningEffort: (effort) => { selectedEfforts.push(effort); }, - resetReasoningEffortToConfig: () => { - resetEffortCount += 1; - }, }); expect(choices.modelChoices).toMatchObject([ { label: "gpt-5-mini", selected: false }, { label: "gpt-5.5", selected: true }, ]); - expect(choices.effortChoices).toMatchObject([ - { label: "Codex default", selected: false }, - { label: "high", selected: true }, - ]); + expect(choices.effortChoices).toMatchObject([{ label: "high", selected: true }]); choices.modelChoices[0]?.onClick(); choices.effortChoices[0]?.onClick(); - choices.effortChoices[1]?.onClick(); expect(selectedModels).toEqual(["gpt-5-mini"]); - expect(resetEffortCount).toBe(1); expect(selectedEfforts).toEqual(["high"]); }); @@ -311,10 +302,7 @@ describe("chat panel surface projections", () => { model: "gpt-5.5", effort: "high", modelChoices: [{ label: "gpt-5.5", selected: true }], - effortChoices: [ - { label: "Codex default", selected: false }, - { label: "high", selected: true }, - ], + effortChoices: [{ label: "high", selected: true }], }, }); }); @@ -365,7 +353,6 @@ function composerSurfaceFixture(overrides: Partial = { runtime: { requestModel: async () => undefined, requestReasoningEffort: async () => undefined, - resetReasoningEffortToConfig: async () => undefined, ...overrides.runtime, }, }; diff --git a/tests/features/chat/panel/toolbar-archive-state.test.tsx b/tests/features/chat/panel/toolbar-archive-state.test.tsx index 7987291c..cc451ea0 100644 --- a/tests/features/chat/panel/toolbar-archive-state.test.tsx +++ b/tests/features/chat/panel/toolbar-archive-state.test.tsx @@ -168,7 +168,6 @@ function surfaceFixture(store: ReturnType, toolbarA runtime: { requestModel: async () => undefined, requestReasoningEffort: async () => undefined, - resetReasoningEffortToConfig: async () => undefined, }, }, };