The best way to control Claude Code, Codex and more from any computer or phone
Assign default capabilities to Codex custom models (#1793)
Julius Marminge committed
Apr 6, 2026 at 15:29 UTC
226ed997e1a6493e6b29d5264e0b0f8173e7c630
3 files changed
+40
-17
apps/server/src/provider/Layers/ClaudeProvider.ts
+16
-8
@@ -27,6 +27,14 @@ import { ClaudeProvider } from "../Services/ClaudeProvider";
27
import { ServerSettingsService } from "../../serverSettings";
28
import { ServerSettingsError } from "@t3tools/contracts";
29
30
+const DEFAULT_CLAUDE_MODEL_CAPABILITIES: ModelCapabilities = {
31
+ reasoningEffortLevels: [],
32
+ supportsFastMode: false,
33
+ supportsThinkingToggle: false,
34
+ contextWindowOptions: [],
35
+ promptInjectedEffortLevels: [],
36
+};
37
+
38
const PROVIDER = "claudeAgent" as const;
39
const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
40
{
@@ -87,13 +95,8 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
95
export function getClaudeModelCapabilities(model: string | null | undefined): ModelCapabilities {
96
const slug = model?.trim();
97
return (
90
- BUILT_IN_MODELS.find((candidate) => candidate.slug === slug)?.capabilities ?? {
91
- reasoningEffortLevels: [],
92
- supportsFastMode: false,
93
- supportsThinkingToggle: false,
94
- contextWindowOptions: [],
95
- promptInjectedEffortLevels: [],
96
- }
98
+ BUILT_IN_MODELS.find((candidate) => candidate.slug === slug)?.capabilities ??
99
+ DEFAULT_CLAUDE_MODEL_CAPABILITIES
100
);
101
}
102
@@ -450,7 +453,12 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
453
Effect.map((settings) => settings.providers.claudeAgent),
454
);
455
const checkedAt = new Date().toISOString();
453
- const models = providerModelsFromSettings(BUILT_IN_MODELS, PROVIDER, claudeSettings.customModels);
456
+ const models = providerModelsFromSettings(
457
+ BUILT_IN_MODELS,
458
+ PROVIDER,
459
+ claudeSettings.customModels,
460
+ DEFAULT_CLAUDE_MODEL_CAPABILITIES,
461
+ );
462
463
if (!claudeSettings.enabled) {
464
return buildServerProvider({
apps/server/src/provider/Layers/CodexProvider.ts
+21
-8
@@ -49,6 +49,19 @@ import { CodexProvider } from "../Services/CodexProvider";
49
import { ServerSettingsService } from "../../serverSettings";
50
import { ServerSettingsError } from "@t3tools/contracts";
51
52
+const DEFAULT_CODEX_MODEL_CAPABILITIES: ModelCapabilities = {
53
+ reasoningEffortLevels: [
54
+ { value: "xhigh", label: "Extra High" },
55
+ { value: "high", label: "High", isDefault: true },
56
+ { value: "medium", label: "Medium" },
57
+ { value: "low", label: "Low" },
58
+ ],
59
+ supportsFastMode: true,
60
+ supportsThinkingToggle: false,
61
+ contextWindowOptions: [],
62
+ promptInjectedEffortLevels: [],
63
+};
64
+
65
const PROVIDER = "codex" as const;
66
const OPENAI_AUTH_PROVIDERS = new Set(["openai"]);
67
const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
@@ -159,13 +172,8 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
172
export function getCodexModelCapabilities(model: string | null | undefined): ModelCapabilities {
173
const slug = model?.trim();
174
return (
162
- BUILT_IN_MODELS.find((candidate) => candidate.slug === slug)?.capabilities ?? {
163
- reasoningEffortLevels: [],
164
- supportsFastMode: false,
165
- supportsThinkingToggle: false,
166
- contextWindowOptions: [],
167
- promptInjectedEffortLevels: [],
168
- }
175
+ BUILT_IN_MODELS.find((candidate) => candidate.slug === slug)?.capabilities ??
176
+ DEFAULT_CODEX_MODEL_CAPABILITIES
177
);
178
}
179
@@ -339,7 +347,12 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
347
Effect.map((settings) => settings.providers.codex),
348
);
349
const checkedAt = new Date().toISOString();
342
- const models = providerModelsFromSettings(BUILT_IN_MODELS, PROVIDER, codexSettings.customModels);
350
+ const models = providerModelsFromSettings(
351
+ BUILT_IN_MODELS,
352
+ PROVIDER,
353
+ codexSettings.customModels,
354
+ DEFAULT_CODEX_MODEL_CAPABILITIES,
355
+ );
356
357
if (!codexSettings.enabled) {
358
return buildServerProvider({
apps/server/src/provider/providerSnapshot.ts
+3
-1
@@ -1,4 +1,5 @@
1
import type {
2
+ ModelCapabilities,
3
ServerProvider,
4
ServerProviderAuth,
5
ServerProviderModel,
@@ -102,6 +103,7 @@ export function providerModelsFromSettings(
103
builtInModels: ReadonlyArray<ServerProviderModel>,
104
provider: ServerProvider["provider"],
105
customModels: ReadonlyArray<string>,
106
+ customModelCapabilities: ModelCapabilities,
107
): ReadonlyArray<ServerProviderModel> {
108
const resolvedBuiltInModels = [...builtInModels];
109
const seen = new Set(resolvedBuiltInModels.map((model) => model.slug));
@@ -117,7 +119,7 @@ export function providerModelsFromSettings(
119
slug: normalized,
120
name: normalized,
121
isCustom: true,
120
- capabilities: null,
122
+ capabilities: customModelCapabilities,
123
});
124
}
125