Skip to content

Commit c661417

Browse files
Preserve default effort in dispatch options
- keep explicit default effort when composing Codex and Claude dispatch options - update adapter expectations for Sonnet 4.6 fallback behavior
1 parent 47baf02 commit c661417

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

apps/server/src/provider/Layers/ClaudeAdapter.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ describe("ClaudeAdapterLive", () => {
347347
);
348348
});
349349

350-
it.effect("ignores unsupported max effort for Sonnet 4.6", () => {
350+
it.effect("falls back to default effort when unsupported max is requested for Sonnet 4.6", () => {
351351
const harness = makeHarness();
352352
return Effect.gen(function* () {
353353
const adapter = yield* ClaudeAdapter;
@@ -365,7 +365,7 @@ describe("ClaudeAdapterLive", () => {
365365
});
366366

367367
const createInput = harness.getLastCreateQueryInput();
368-
assert.equal(createInput?.options.effort, undefined);
368+
assert.equal(createInput?.options.effort, "high");
369369
}).pipe(
370370
Effect.provideService(Random.Random, makeDeterministicRandomService()),
371371
Effect.provide(harness.layer),
@@ -532,7 +532,7 @@ describe("ClaudeAdapterLive", () => {
532532
});
533533

534534
const createInput = harness.getLastCreateQueryInput();
535-
assert.equal(createInput?.options.effort, undefined);
535+
assert.equal(createInput?.options.effort, "high");
536536
const promptText = yield* Effect.promise(() => readFirstPromptText(createInput));
537537
assert.equal(promptText, "Ultrathink:\nInvestigate the edge cases");
538538
}).pipe(

apps/web/src/components/chat/composerProviderRegistry.test.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ describe("getComposerProviderState", () => {
8484
expect(state).toEqual({
8585
provider: "codex",
8686
promptEffort: "high",
87-
modelOptionsForDispatch: undefined,
87+
modelOptionsForDispatch: {
88+
reasoningEffort: "high",
89+
},
8890
});
8991
});
9092

@@ -129,12 +131,13 @@ describe("getComposerProviderState", () => {
129131
provider: "codex",
130132
promptEffort: "high",
131133
modelOptionsForDispatch: {
134+
reasoningEffort: "high",
132135
fastMode: true,
133136
},
134137
});
135138
});
136139

137-
it("drops explicit codex default/off overrides from dispatch while keeping the selected effort label", () => {
140+
it("preserves codex default effort explicitly in dispatch options", () => {
138141
const state = getComposerProviderState({
139142
provider: "codex",
140143
model: "gpt-5.4",
@@ -151,7 +154,9 @@ describe("getComposerProviderState", () => {
151154
expect(state).toEqual({
152155
provider: "codex",
153156
promptEffort: "high",
154-
modelOptionsForDispatch: undefined,
157+
modelOptionsForDispatch: {
158+
reasoningEffort: "high",
159+
},
155160
});
156161
});
157162

@@ -167,7 +172,9 @@ describe("getComposerProviderState", () => {
167172
expect(state).toEqual({
168173
provider: "claudeAgent",
169174
promptEffort: "high",
170-
modelOptionsForDispatch: undefined,
175+
modelOptionsForDispatch: {
176+
effort: "high",
177+
},
171178
});
172179
});
173180

@@ -236,12 +243,13 @@ describe("getComposerProviderState", () => {
236243
provider: "claudeAgent",
237244
promptEffort: "high",
238245
modelOptionsForDispatch: {
246+
effort: "high",
239247
fastMode: true,
240248
},
241249
});
242250
});
243251

244-
it("drops explicit Claude default/off overrides from dispatch while keeping the selected effort label", () => {
252+
it("preserves Claude default effort explicitly in dispatch options", () => {
245253
const state = getComposerProviderState({
246254
provider: "claudeAgent",
247255
model: "claude-opus-4-6",
@@ -258,7 +266,9 @@ describe("getComposerProviderState", () => {
258266
expect(state).toEqual({
259267
provider: "claudeAgent",
260268
promptEffort: "high",
261-
modelOptionsForDispatch: undefined,
269+
modelOptionsForDispatch: {
270+
effort: "high",
271+
},
262272
});
263273
});
264274
});

0 commit comments

Comments
 (0)