@devries-cameron20 / t3code-1 / commits / 508872e04b
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Preserve explicit DEFAULT_MODEL draft overrides

Co-authored-by: codex <codex@users.noreply.github.com>

Julius Marminge committed Mar 1, 2026 at 18:49 UTC 508872e04b87dc7cb53632988115b54b15f78e06
2 files changed +21 -6
apps/web/src/composerDraftStore.test.ts
+20
@@ -242,3 +242,23 @@ describe("composerDraftStore project draft thread mapping", () => {
242 });
243 });
244 });
245 +
246 +describe("composerDraftStore setModel", () => {
247 + const threadId = ThreadId.makeUnsafe("thread-model");
248 +
249 + beforeEach(() => {
250 + useComposerDraftStore.setState({
251 + draftsByThreadId: {},
252 + draftThreadsByThreadId: {},
253 + projectDraftThreadIdByProjectId: {},
254 + });
255 + });
256 +
257 + it("keeps explicit DEFAULT_MODEL overrides instead of coercing to null", () => {
258 + const store = useComposerDraftStore.getState();
259 +
260 + store.setModel(threadId, "gpt-5.3-codex");
261 +
262 + expect(useComposerDraftStore.getState().draftsByThreadId[threadId]?.model).toBe("gpt-5.3-codex");
263 + });
264 +});
apps/web/src/composerDraftStore.ts
+1 -6
@@ -1,5 +1,4 @@
1 import {
2 - DEFAULT_MODEL,
2 DEFAULT_REASONING,
3 ProjectId,
4 REASONING_OPTIONS,
@@ -671,11 +670,7 @@ export const useComposerDraftStore = create<ComposerDraftStoreState>()(
670 if (threadId.length === 0) {
671 return;
672 }
674 - const normalizedModelCandidate = normalizeModelSlug(model);
675 - const normalizedModel =
676 - normalizedModelCandidate && normalizedModelCandidate !== DEFAULT_MODEL
677 - ? normalizedModelCandidate
678 - : null;
673 + const normalizedModel = normalizeModelSlug(model) ?? null;
674 set((state) => {
675 const existing = state.draftsByThreadId[threadId];
676 if (!existing && normalizedModel === null) {