Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit 01d914f

Browse files
fix(mobile): scope reasoning options to model
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
1 parent 688d0e8 commit 01d914f

4 files changed

Lines changed: 26 additions & 11 deletions

File tree

‎apps/mobile/src/app/task/index.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import {
5050
DEFAULT_REASONING,
5151
EXECUTION_MODES,
5252
type ExecutionMode,
53+
getReasoningLevels,
5354
MODELS,
5455
modeLabel,
5556
modelLabel,
@@ -625,7 +626,7 @@ export default function NewTaskScreen() {
625626
icon={
626627
<BrainIcon size={14} color={themeColors.gray[11]} />
627628
}
628-
label={reasoningLabel(reasoning)}
629+
label={reasoningLabel(reasoning, model)}
629630
onPress={() => setReasoningSheetOpen(true)}
630631
/>
631632
) : null}
@@ -756,7 +757,7 @@ export default function NewTaskScreen() {
756757
usePreferencesStore.getState().setLastUsedReasoningEffort(next);
757758
}}
758759
onClose={() => setReasoningSheetOpen(false)}
759-
options={REASONING_LEVELS.map((reasoningLevel) => ({
760+
options={getReasoningLevels(model).map((reasoningLevel) => ({
760761
value: reasoningLevel.value,
761762
label: reasoningLevel.label,
762763
icon: <BrainIcon size={16} color={themeColors.gray[11]} />,

‎apps/mobile/src/features/tasks/composer/TaskChatComposer.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ import {
4949
DEFAULT_REASONING,
5050
EXECUTION_MODES,
5151
type ExecutionMode,
52+
getReasoningLevels,
5253
MODELS,
5354
modeLabel,
5455
modelLabel,
5556
modelSupportsReasoning,
56-
REASONING_LEVELS,
5757
type ReasoningEffort,
5858
reasoningLabel,
5959
} from "./options";
@@ -382,7 +382,7 @@ export function TaskChatComposer({
382382
{showReasoningPill ? (
383383
<Pill
384384
icon={<BrainIcon size={14} color={themeColors.gray[11]} />}
385-
label={reasoningLabel(reasoning)}
385+
label={reasoningLabel(reasoning, model)}
386386
onPress={() => setReasoningSheetOpen(true)}
387387
/>
388388
) : null}
@@ -470,7 +470,7 @@ export function TaskChatComposer({
470470
value={reasoning}
471471
onChange={(v) => onReasoningChange(v as ReasoningEffort)}
472472
onClose={() => setReasoningSheetOpen(false)}
473-
options={REASONING_LEVELS.map((r) => ({
473+
options={getReasoningLevels(model).map((r) => ({
474474
value: r.value,
475475
label: r.label,
476476
icon: <BrainIcon size={16} color={themeColors.gray[11]} />,

‎apps/mobile/src/features/tasks/composer/options.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
22
import {
33
DEFAULT_MODEL,
44
DEFAULT_REASONING,
5+
getReasoningLevels,
56
modelSupportsReasoning,
67
REASONING_LEVELS,
78
} from "./options";
@@ -24,4 +25,10 @@ describe("task composer options", () => {
2425
expect(modelSupportsReasoning("claude-opus-4-8")).toBe(true);
2526
expect(modelSupportsReasoning("claude-haiku-4-5")).toBe(false);
2627
});
28+
29+
it("limits reasoning options to the selected model", () => {
30+
expect(
31+
getReasoningLevels("claude-sonnet-4-6").map((option) => option.value),
32+
).toEqual(["low", "medium", "high"]);
33+
});
2734
});

‎apps/mobile/src/features/tasks/composer/options.ts‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,17 @@ export const DEFAULT_MODEL =
8181
DEFAULT_GATEWAY_MODEL;
8282
export const DEFAULT_REASONING: ReasoningEffort = DEFAULT_REASONING_EFFORT;
8383

84-
export const REASONING_LEVELS: {
84+
export function getReasoningLevels(model: string): {
8585
value: ReasoningEffort;
8686
label: string;
87-
}[] = (getReasoningEffortOptions("claude", DEFAULT_MODEL) ?? []).map(
88-
(option) => ({ value: option.value, label: option.name }),
89-
);
87+
}[] {
88+
return (getReasoningEffortOptions("claude", model) ?? []).map((option) => ({
89+
value: option.value,
90+
label: option.name,
91+
}));
92+
}
93+
94+
export const REASONING_LEVELS = getReasoningLevels(DEFAULT_MODEL);
9095

9196
export function modelLabel(value: string): string {
9297
return MODELS.find((m) => m.value === value)?.label ?? value;
@@ -96,8 +101,10 @@ export function modeLabel(value: ExecutionMode): string {
96101
return EXECUTION_MODES.find((m) => m.value === value)?.label ?? value;
97102
}
98103

99-
export function reasoningLabel(value: ReasoningEffort): string {
100-
return REASONING_LEVELS.find((r) => r.value === value)?.label ?? value;
104+
export function reasoningLabel(value: ReasoningEffort, model: string): string {
105+
return (
106+
getReasoningLevels(model).find((r) => r.value === value)?.label ?? value
107+
);
101108
}
102109

103110
export function modelSupportsReasoning(value: string): boolean {

0 commit comments

Comments
 (0)