Skip to content

Build your personal knowledge base with Trilium Notes

fix(llm): list the current Claude Code models

s31tege3c6047255e0
diff --git a/apps/server/src/services/llm/providers/claude_agent.spec.ts b/apps/server/src/services/llm/providers/claude_agent.spec.ts
index 34d322b267..a99da476c2 100644
--- a/apps/server/src/services/llm/providers/claude_agent.spec.ts
+++ b/apps/server/src/services/llm/providers/claude_agent.spec.ts
@@ -283,7 +283,7 @@ describe("ClaudeAgentProvider.chatChunks", () => {
type: "usage",
// No cost even though the SDK result carries total_cost_usd: usage is
// covered by the subscription, so a per-turn dollar figure isn't shown.
- usage: { promptTokens: 100, completionTokens: 40, totalTokens: 140, model: "Claude Sonnet 5", provider: "claude-agent" }
+ usage: { promptTokens: 100, completionTokens: 40, totalTokens: 140, model: "Claude Sonnet 5.5", provider: "claude-agent" }
},
{ type: "done" }
]);
@@ -742,8 +742,14 @@ describe("ClaudeAgentProvider.chatChunks", () => {
it("exposes the subscription model list, zero pricing, and no chat() implementation", () => {
const provider = new ClaudeAgentProvider();
const models = provider.getAvailableModels();
- expect(models.some(m => m.id === "claude-sonnet-5" && m.isDefault)).toBe(true);
- expect(provider.getModelPricing("claude-sonnet-5")).toEqual(expect.objectContaining({ input: 0, output: 0 }));
+ expect(models.some(m => m.id === "claude-sonnet-5-5" && m.isDefault)).toBe(true);
+ // The current line-up leads the list; what it replaced is still listed, as legacy.
+ expect(models.filter(m => !m.isLegacy).map(m => m.id)).toEqual([
+ "claude-fable-5-1", "claude-opus-5-5", "claude-sonnet-5-5", "claude-haiku-5-5"
+ ]);
+ expect(models.find(m => m.id === "claude-fable-5")).toMatchObject({ isLegacy: true });
+ expect(provider.getModelPricing("claude-sonnet-5-5"))
+ .toEqual(expect.objectContaining({ input: 0, output: 0 }));
// A long-context variant prices like its base model, not as an unknown.
expect(provider.getModelPricing("claude-opus-4-8[1m]")).toEqual(expect.objectContaining({ input: 0, output: 0 }));
expect(provider.getModelPricing("no-such-model")).toBeUndefined();
diff --git a/apps/server/src/services/llm/providers/claude_agent.ts b/apps/server/src/services/llm/providers/claude_agent.ts
index 701a83c703..c2edef9f0f 100644
--- a/apps/server/src/services/llm/providers/claude_agent.ts
+++ b/apps/server/src/services/llm/providers/claude_agent.ts
@@ -71,11 +71,42 @@ const SUPPORTED_IMAGE_MIMES = new Set<string>(["image/png", "image/jpeg", "image
*/
const { models: AVAILABLE_MODELS, pricing: MODEL_PRICING } = buildModelList([
// ===== Current Models =====
+ {
+ id: "claude-fable-5-1",
+ name: "Claude Fable 5.1",
+ pricing: { input: 0, output: 0 },
+ contextWindow: 1000000,
+ isSubscription: true
+ },
+ {
+ id: "claude-opus-5-5",
+ name: "Claude Opus 5.5",
+ pricing: { input: 0, output: 0 },
+ contextWindow: 1000000,
+ isSubscription: true
+ },
+ {
+ id: "claude-sonnet-5-5",
+ name: "Claude Sonnet 5.5",
+ pricing: { input: 0, output: 0 },
+ contextWindow: 1000000,
+ isDefault: true,
+ isSubscription: true
+ },
+ {
+ id: "claude-haiku-5-5",
+ name: "Claude Haiku 5.5",
+ pricing: { input: 0, output: 0 },
+ contextWindow: 1000000,
+ isSubscription: true
+ },
+ // ===== Legacy Models =====
{
id: "claude-fable-5",
name: "Claude Fable 5",
pricing: { input: 0, output: 0 },
contextWindow: 1000000,
+ isLegacy: true,
isSubscription: true
},
{
@@ -83,6 +114,7 @@ const { models: AVAILABLE_MODELS, pricing: MODEL_PRICING } = buildModelList([
name: "Claude Opus 4.8",
pricing: { input: 0, output: 0 },
contextWindow: 1000000,
+ isLegacy: true,
isSubscription: true
},
{
@@ -90,6 +122,7 @@ const { models: AVAILABLE_MODELS, pricing: MODEL_PRICING } = buildModelList([
name: "Claude Opus 4.7",
pricing: { input: 0, output: 0 },
contextWindow: 1000000,
+ isLegacy: true,
isSubscription: true
},
{
@@ -97,7 +130,7 @@ const { models: AVAILABLE_MODELS, pricing: MODEL_PRICING } = buildModelList([
name: "Claude Sonnet 5",
pricing: { input: 0, output: 0 },
contextWindow: 1000000,
- isDefault: true,
+ isLegacy: true,
isSubscription: true
},
{
@@ -105,9 +138,9 @@ const { models: AVAILABLE_MODELS, pricing: MODEL_PRICING } = buildModelList([
name: "Claude Haiku 4.5",
pricing: { input: 0, output: 0 },
contextWindow: 200000,
+ isLegacy: true,
isSubscription: true
},
- // ===== Legacy Models =====
{
id: "claude-sonnet-4-6",
name: "Claude Sonnet 4.6",