Skip to content

Commit 9f57633

Browse files
juliusmarmingecodex
andcommitted
fix: preserve xhigh effort for Claude Fable 5
Co-authored-by: codex <[email protected]>
1 parent e8d43cb commit 9f57633

2 files changed

Lines changed: 51 additions & 5 deletions

File tree

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,29 @@ describe("ClaudeAdapterLive", () => {
447447
);
448448
});
449449

450+
it.effect("preserves xhigh effort for Claude Fable 5", () => {
451+
const harness = makeHarness();
452+
return Effect.gen(function* () {
453+
const adapter = yield* ClaudeAdapter;
454+
yield* adapter.startSession({
455+
threadId: THREAD_ID,
456+
provider: ProviderDriverKind.make("claudeAgent"),
457+
modelSelection: createModelSelection(
458+
ProviderInstanceId.make("claudeAgent"),
459+
"claude-fable-5",
460+
[{ id: "effort", value: "xhigh" }],
461+
),
462+
runtimeMode: "full-access",
463+
});
464+
465+
const createInput = harness.getLastCreateQueryInput();
466+
assert.equal(createInput?.options.effort, "xhigh");
467+
}).pipe(
468+
Effect.provideService(Random.Random, makeDeterministicRandomService()),
469+
Effect.provide(harness.layer),
470+
);
471+
});
472+
450473
it.effect("falls back to default effort when unsupported max is requested for Sonnet 4.6", () => {
451474
const harness = makeHarness();
452475
return Effect.gen(function* () {

‎apps/server/src/provider/Layers/ClaudeProvider.ts‎

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const MINIMUM_CLAUDE_OPUS_4_8_VERSION = "2.1.154";
5353
const MINIMUM_CLAUDE_OPUS_4_7_VERSION = "2.1.111";
5454

5555
const CLAUDE_EFFORT_OPTIONS = {
56-
fable48: [
56+
fable50: [
5757
{ value: "low", label: "Low" },
5858
{ value: "medium", label: "Medium" },
5959
{ value: "high", label: "High", isDefault: true },
@@ -111,7 +111,15 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
111111
buildSelectOptionDescriptor({
112112
id: "effort",
113113
label: "Reasoning",
114-
options: CLAUDE_EFFORT_OPTIONS.fable48,
114+
options: [
115+
{ value: "low", label: "Low" },
116+
{ value: "medium", label: "Medium" },
117+
{ value: "high", label: "High", isDefault: true },
118+
{ value: "xhigh", label: "Extra High" },
119+
{ value: "max", label: "Max" },
120+
{ value: "ultracode", label: "Ultracode" },
121+
{ value: "ultrathink", label: "Ultrathink" },
122+
],
115123
promptInjectedValues: ["ultrathink"],
116124
}),
117125
buildSelectOptionDescriptor({
@@ -134,7 +142,15 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
134142
buildSelectOptionDescriptor({
135143
id: "effort",
136144
label: "Reasoning",
137-
options: CLAUDE_EFFORT_OPTIONS.opus48,
145+
options: [
146+
{ value: "low", label: "Low" },
147+
{ value: "medium", label: "Medium" },
148+
{ value: "high", label: "High", isDefault: true },
149+
{ value: "xhigh", label: "Extra High" },
150+
{ value: "max", label: "Max" },
151+
{ value: "ultracode", label: "Ultracode" },
152+
{ value: "ultrathink", label: "Ultrathink" },
153+
],
138154
promptInjectedValues: ["ultrathink"],
139155
}),
140156
buildBooleanOptionDescriptor({
@@ -161,7 +177,14 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
161177
buildSelectOptionDescriptor({
162178
id: "effort",
163179
label: "Reasoning",
164-
options: CLAUDE_EFFORT_OPTIONS.opus47,
180+
options: [
181+
{ value: "low", label: "Low" },
182+
{ value: "medium", label: "Medium" },
183+
{ value: "high", label: "High" },
184+
{ value: "xhigh", label: "Extra High", isDefault: true },
185+
{ value: "max", label: "Max" },
186+
{ value: "ultrathink", label: "Ultrathink" },
187+
],
165188
promptInjectedValues: ["ultrathink"],
166189
}),
167190
buildBooleanOptionDescriptor({
@@ -347,7 +370,7 @@ export function normalizeClaudeCliEffort(
347370
if (effort === "ultracode") {
348371
return "xhigh";
349372
}
350-
if (effort === "xhigh" && model !== "claude-opus-4-8") {
373+
if (effort === "xhigh" && model !== "claude-fable-5" && model !== "claude-opus-4-8") {
351374
return "max";
352375
}
353376
if (effort === "max" && model === "claude-sonnet-4-6") {

0 commit comments

Comments
 (0)