authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 16:42:46-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-05 23:00:41-08:00
logfeff86638ef7f08f6766350b8e84b151972eaaa7
tree0d43efc232eaf8a6acfae60ad954a696e6fe6406
parentad28eaa86f851c6cd28573bd76635b550b43a530

Fix effort and provider handling in thread turn start

- Only include `effort` in start command when a value is selected - Persist effort selection via composer draft state and hide picker when unavailable - Add optional `provider` to `ClientThreadTurnStartCommand` - Simplify thread model fallback selection in `ChatView`

2 files changed, 11 insertions(+), 14 deletions(-)

apps/web/src/components/ChatView.tsx+10-14
...@@ -2153,13 +2153,7 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -2153,13 +2153,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
2153 }2153 }
2154 }2154 }
2155 const title = truncateTitle(titleSeed);2155 const title = truncateTitle(titleSeed);
2156 let threadCreateModel = selectedModel;2156 let threadCreateModel: ModelSlug = selectedModel || (activeProject.model as ModelSlug) || DEFAULT_MODEL;
2157 if (!threadCreateModel) {
2158 threadCreateModel = activeProject.model;
2159 }
2160 if (!threadCreateModel) {
2161 threadCreateModel = DEFAULT_MODEL;
2162 }
21632157
2164 if (isLocalDraftThread) {2158 if (isLocalDraftThread) {
2165 await api.orchestration.dispatchCommand({2159 await api.orchestration.dispatchCommand({
...@@ -2228,7 +2222,7 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -2228,7 +2222,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
2228 },2222 },
2229 model: selectedModel || undefined,2223 model: selectedModel || undefined,
2230 provider: selectedProvider,2224 provider: selectedProvider,
2231 ...(supportsReasoningEffort ? { effort: selectedEffort } : {}),2225 ...(supportsReasoningEffort && selectedEffort ? { effort: selectedEffort } : {}),
2232 assistantDeliveryMode: settings.enableAssistantStreaming ? "streaming" : "buffered",2226 assistantDeliveryMode: settings.enableAssistantStreaming ? "streaming" : "buffered",
2233 approvalPolicy,2227 approvalPolicy,
2234 sandboxMode,2228 sandboxMode,
...@@ -2387,7 +2381,7 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -2387,7 +2381,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
2387 );2381 );
2388 const onEffortSelect = useCallback(2382 const onEffortSelect = useCallback(
2389 (effort: CodexReasoningEffort) => {2383 (effort: CodexReasoningEffort) => {
2390 setSelectedEffort(effort);2384 setComposerDraftEffort(threadId, effort);
2391 scheduleComposerFocus();2385 scheduleComposerFocus();
2392 },2386 },
2393 [scheduleComposerFocus, setComposerDraftEffort, threadId],2387 [scheduleComposerFocus, setComposerDraftEffort, threadId],
...@@ -2850,11 +2844,13 @@ export default function ChatView({ threadId }: ChatViewProps) {...@@ -2850,11 +2844,13 @@ export default function ChatView({ threadId }: ChatViewProps) {
2850 <Separator orientation="vertical" className="mx-0.5 hidden h-4 sm:block" />2844 <Separator orientation="vertical" className="mx-0.5 hidden h-4 sm:block" />
28512845
2852 {/* Reasoning effort */}2846 {/* Reasoning effort */}
2853 <ReasoningEffortPicker2847 {selectedEffort != null && (
2854 effort={selectedEffort}2848 <ReasoningEffortPicker
2855 options={reasoningOptions}2849 effort={selectedEffort}
2856 onEffortChange={onEffortSelect}2850 options={reasoningOptions}
2857 />2851 onEffortChange={onEffortSelect}
2852 />
2853 )}
2858 </>2854 </>
2859 ) : null}2855 ) : null}
28602856
packages/contracts/src/orchestration.ts+1
...@@ -348,6 +348,7 @@ export const ClientThreadTurnStartCommand = Schema.Struct({...@@ -348,6 +348,7 @@ export const ClientThreadTurnStartCommand = Schema.Struct({
348 text: Schema.String,348 text: Schema.String,
349 attachments: Schema.Array(UploadChatAttachment),349 attachments: Schema.Array(UploadChatAttachment),
350 }),350 }),
351 provider: Schema.optional(ProviderKind),
351 model: Schema.optional(TrimmedNonEmptyString),352 model: Schema.optional(TrimmedNonEmptyString),
352 effort: Schema.optional(TrimmedNonEmptyString),353 effort: Schema.optional(TrimmedNonEmptyString),
353 assistantDeliveryMode: Schema.optional(AssistantDeliveryMode),354 assistantDeliveryMode: Schema.optional(AssistantDeliveryMode),