Skip to content

Commit dc2058e

Browse files
fix tsc
1 parent 51b594d commit dc2058e

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ import { ClaudeProvider } from "../Services/ClaudeProvider";
2727
import { ServerSettingsService } from "../../serverSettings";
2828
import { ServerSettingsError } from "@t3tools/contracts";
2929

30+
const DEFAULT_CLAUDE_MODEL_CAPABILITIES: ModelCapabilities = {
31+
reasoningEffortLevels: [],
32+
supportsFastMode: false,
33+
supportsThinkingToggle: false,
34+
contextWindowOptions: [],
35+
promptInjectedEffortLevels: [],
36+
};
37+
3038
const PROVIDER = "claudeAgent" as const;
3139
const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
3240
{
@@ -87,13 +95,8 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
8795
export function getClaudeModelCapabilities(model: string | null | undefined): ModelCapabilities {
8896
const slug = model?.trim();
8997
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
97100
);
98101
}
99102

@@ -450,7 +453,12 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
450453
Effect.map((settings) => settings.providers.claudeAgent),
451454
);
452455
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+
);
454462

455463
if (!claudeSettings.enabled) {
456464
return buildServerProvider({

0 commit comments

Comments
 (0)