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 23, 04:15 UTC
fix(server): preserve explicit effort for unknown Claude models (#20849)
Yannic Charlon committed
Oct 19, 2026 at 03:24 UTC
76f57f9b84ee53d9b998710417d9f8bf02d192dc
4 files changed
+40
-2
apps/server/src/claudeModelOptions.test.ts
+19
@@ -49,6 +49,25 @@ describe("compileClaudeModelSelection", () => {
49
).toMatchObject({ effort: "high", promptEffort: "ultrathink" });
50
});
51
52
+ it("keeps explicit effort for models missing from the local catalog", () => {
53
+ expect(
54
+ compileClaudeModelSelection(
55
+ selection("claude-pool-model-not-in-catalog", [{ id: "effort", value: "max" }]),
56
+ ).effort,
57
+ ).toBe("max");
58
+ expect(
59
+ compileClaudeModelSelection(selection("claude-pool-model-not-in-catalog", [])).effort,
60
+ ).toBeUndefined();
61
+ });
62
+
63
+ it("omits unsupported effort for models missing from the local catalog", () => {
64
+ expect(
65
+ compileClaudeModelSelection(
66
+ selection("claude-pool-model-not-in-catalog", [{ id: "effort", value: "brutal" }]),
67
+ ).effort,
68
+ ).toBeUndefined();
69
+ });
70
+
71
it("compiles the thinking toggle for models that expose it", () => {
72
expect(
73
compileClaudeModelSelection(selection("claude-haiku-4-5", [{ id: "thinking", value: false }]))
apps/server/src/provider/ClaudeModelCatalog.test.ts
+13
-1
@@ -192,6 +192,16 @@ describe("Claude model catalog", () => {
192
assert.isFalse(hasValidClaudeManifestAdapters(malformed));
193
});
194
195
+ it("preserves only SDK effort levels for uncatalogued models", () => {
196
+ const catalog = catalogFromManifest(manifest());
197
+ for (const effort of ["low", "medium", "high", "xhigh", "max"]) {
198
+ assert.strictEqual(resolveClaudeCatalogEffort(catalog, "custom", ` ${effort} `), effort);
199
+ }
200
+ for (const effort of [undefined, null, "", " ", "brutal", "extreme", "HIGH", "ultrathink"]) {
201
+ assert.isUndefined(resolveClaudeCatalogEffort(catalog, "custom", effort));
202
+ }
203
+ });
204
+
205
it("appends custom models with their own descriptors and keeps bare slugs opaque", () => {
206
const catalog = scopeClaudeModelCatalog(catalogFromManifest(manifest()), [
207
"synthetic",
@@ -215,7 +225,9 @@ describe("Claude model catalog", () => {
225
]);
226
227
assert.strictEqual(resolveClaudeModelSlug(catalog, "synthetic"), "synthetic");
218
- assert.strictEqual(resolveClaudeCatalogEffort(catalog, "synthetic", "extreme"), undefined);
228
+ assert.isUndefined(resolveClaudeCatalogEffort(catalog, "synthetic", "extreme"));
229
+ assert.strictEqual(resolveClaudeCatalogEffort(catalog, "synthetic", "max"), "max");
230
+ assert.strictEqual(normalizeClaudeCatalogEffort(catalog, "max", "synthetic"), "max");
231
232
assert.strictEqual(
233
resolveClaudeCatalogEffort(catalog, "claude-custom-tuned", "brutal"),
apps/server/src/provider/ClaudeModelCatalog.ts
+7
@@ -209,6 +209,13 @@ export function resolveClaudeCatalogEffort(
209
model: string | null | undefined,
210
raw: string | null | undefined,
211
): string | undefined {
212
+ if (!resolveClaudeCatalogModel(catalog, model)) {
213
+ const effort = raw?.trim();
214
+ return effort && ["low", "medium", "high", "xhigh", "max"].includes(effort)
215
+ ? effort
216
+ : undefined;
217
+ }
218
+
219
const caps = getClaudeCatalogModelCapabilities(catalog, model);
220
const descriptors = getProviderOptionDescriptors({
221
caps,
apps/server/src/textGeneration/ClaudeTextGeneration.test.ts
+1
-1
@@ -237,7 +237,7 @@ it.layer(layerClaudeTextGenerationTest)("ClaudeTextGeneration", (it) => {
237
body: "",
238
},
239
}),
240
- argsMustContain: `--model ${SYNTHETIC_CLAUDE_COLLIDING_ALIAS} --settings`,
240
+ argsMustContain: `--model ${SYNTHETIC_CLAUDE_COLLIDING_ALIAS} --effort max --settings`,
241
claudeConfig: { customModels: [SYNTHETIC_CLAUDE_COLLIDING_ALIAS] },
242
},
243
(textGeneration) =>