The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 10:00 UTC
Scope composer draft reasoning effort to Codex options
- Switch draft store types to `CodexReasoningEffort` - Validate and default effort using Codex-specific option/default constants
Julius Marminge committed
Mar 1, 2026 at 23:55 UTC
ad28eaa86f851c6cd28573bd76635b550b43a530
1 file changed
+14
-10
apps/web/src/composerDraftStore.ts
+14
-10
@@ -1,10 +1,10 @@
1
import {
2
- DEFAULT_REASONING,
2
+ DEFAULT_REASONING_EFFORT_BY_PROVIDER,
3
ProjectId,
4
- REASONING_OPTIONS,
4
+ REASONING_EFFORT_OPTIONS_BY_PROVIDER,
5
ThreadId,
6
normalizeModelSlug,
7
- type ReasoningEffort,
7
+ type CodexReasoningEffort,
8
} from "@t3tools/contracts";
9
import type { ChatImageAttachment } from "./types";
10
import { create } from "zustand";
@@ -30,7 +30,7 @@ interface PersistedComposerThreadDraftState {
30
prompt: string;
31
attachments: PersistedComposerImageAttachment[];
32
model?: string | null;
33
- effort?: ReasoningEffort | null;
33
+ effort?: CodexReasoningEffort | null;
34
}
35
36
interface PersistedDraftThreadState {
@@ -53,7 +53,7 @@ interface ComposerThreadDraftState {
53
nonPersistedImageIds: string[];
54
persistedAttachments: PersistedComposerImageAttachment[];
55
model: string | null;
56
- effort: ReasoningEffort | null;
56
+ effort: CodexReasoningEffort | null;
57
}
58
59
export interface DraftThreadState {
@@ -99,7 +99,7 @@ interface ComposerDraftStoreState {
99
clearDraftThread: (threadId: ThreadId) => void;
100
setPrompt: (threadId: ThreadId, prompt: string) => void;
101
setModel: (threadId: ThreadId, model: string | null | undefined) => void;
102
- setEffort: (threadId: ThreadId, effort: ReasoningEffort | null | undefined) => void;
102
+ setEffort: (threadId: ThreadId, effort: CodexReasoningEffort | null | undefined) => void;
103
addImage: (threadId: ThreadId, image: ComposerImageAttachment) => void;
104
addImages: (threadId: ThreadId, images: ComposerImageAttachment[]) => void;
105
removeImage: (threadId: ThreadId, imageId: string) => void;
@@ -133,7 +133,9 @@ const EMPTY_THREAD_DRAFT = Object.freeze({
133
effort: null,
134
}) as ComposerThreadDraftState;
135
136
-const REASONING_EFFORT_VALUES = new Set<ReasoningEffort>(REASONING_OPTIONS);
136
+const REASONING_EFFORT_VALUES = new Set<CodexReasoningEffort>(
137
+ REASONING_EFFORT_OPTIONS_BY_PROVIDER.codex,
138
+);
139
140
function createEmptyThreadDraft(): ComposerThreadDraftState {
141
return {
@@ -310,8 +312,8 @@ function normalizePersistedComposerDraftState(value: unknown): PersistedComposer
312
const effortCandidate =
313
typeof draftCandidate.effort === "string" ? draftCandidate.effort : null;
314
const effort =
313
- effortCandidate && REASONING_EFFORT_VALUES.has(effortCandidate as ReasoningEffort)
314
- ? (effortCandidate as ReasoningEffort)
315
+ effortCandidate && REASONING_EFFORT_VALUES.has(effortCandidate as CodexReasoningEffort)
316
+ ? (effortCandidate as CodexReasoningEffort)
317
: null;
318
if (prompt.length === 0 && attachments.length === 0 && !model && !effort) {
319
continue;
@@ -706,7 +708,9 @@ export const useComposerDraftStore = create<ComposerDraftStoreState>()(
708
return;
709
}
710
const nextEffort =
709
- effort && REASONING_EFFORT_VALUES.has(effort) && effort !== DEFAULT_REASONING
711
+ effort &&
712
+ REASONING_EFFORT_VALUES.has(effort) &&
713
+ effort !== DEFAULT_REASONING_EFFORT_BY_PROVIDER.codex
714
? effort
715
: null;
716
set((state) => {