Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(ai): Claude Sonnet 5.5 support, Sonnet 5 price, and Claude 5 request shape (#5688, #5690)
garrytan8f026126549f
diff --git a/bun.lock b/bun.lockindex 7d2add681e..97b5dd14fa 100644--- a/bun.lock+++ b/bun.lock@@ -5,7 +5,7 @@"": {"name": "gbrain","dependencies": {- "@ai-sdk/anthropic": "^3.0.71",+ "@ai-sdk/anthropic": "^3.0.125","@ai-sdk/google": "^3.0.64","@ai-sdk/openai": "^3.0.53","@ai-sdk/openai-compatible": "^2.0.41",@@ -52,7 +52,7 @@"@electric-sql/pglite",],"overrides": {- "@ai-sdk/provider-utils": "4.0.33",+ "@ai-sdk/provider-utils": "4.0.56","@hono/node-server": "^2.0.5","body-parser": "^2.3.0","fast-uri": "3.1.8",@@ -65,7 +65,7 @@"qs": "6.16.0",},"packages": {- "@ai-sdk/anthropic": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.10", "@ai-sdk/provider-utils": "4.0.26" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Xew9rfz9WWhDSyF8rNhjT/XWOWelNfJrMlmG0Ahw210hStisRpQZ1s+7VeI9JTJOZ5y5tXqBi5kfPwYnCfyRTA=="],+ "@ai-sdk/anthropic": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.18", "@ai-sdk/provider-utils": "4.0.56" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-oCBy62UBmf94aptAkb+0kB5ac4503cta2SXEGAGNweEscRmeSWsDVx8YWVdJ5vZqFoyJdyWTrKrZ2J9IodWbwA=="],"@ai-sdk/gateway": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.10", "@ai-sdk/provider-utils": "4.0.26", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-r6dOqThjODp1vOhGRJg2OCmyB/ZOQtGx1esZ2SDvwDX5XoX8dBqYaYjLg8MPXTzMGJSgOkJyCxWgUcZtAl16pw=="],@@ -75,9 +75,9 @@"@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.10", "@ai-sdk/provider-utils": "4.0.26" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-5YBvurNL7Oj7mT3srws4Rh4cQidoorfEGObAOb5jV40eld8IC7EkXWARZjnWYqgYzabUs6Sn6muiXfQVkgOyOQ=="],- "@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw=="],+ "@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-IpefF5ssZVOZCD4Wu7zxt6PwZoGT2HLVjxpJ10Bjx6EAmRfLYJPjyrfxb0RYDlwvXnDb9nkQ7Do/oJVDuRFzew=="],- "@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.12", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.8" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-nJ0bAfegMAIJtrzMJtbzer1cS3nb7c7DsyU1S4nrPm7ZU0Mn6SBBZv5IGZZGTbpWTJwqKTSPeZJTXalbAxt1BA=="],+ "@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.18", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.8", "undici": "^6.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Svfg3OwsLRqkDDn/lTk6x3Dmrlft+u3Xs2M5YvVqpuDY9sftY125xJ9jnref63W/CrFln0j7Ij3/YgG9WHpOqA=="],"@anthropic-ai/sdk": ["@anthropic-ai/[email protected]", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-nuKvp7wOIz6BFei8WrTdhmSsx5mwnArYyJgh4+vYu3V4J0Ltb8Xm3odPm51n1aSI0XxNCrDl7O88cxCtUdAkaw=="],@@ -573,6 +573,8 @@"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],+ "undici": ["[email protected]", "", {}, "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg=="],+"undici-types": ["[email protected]", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],"unpipe": ["[email protected]", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],@@ -599,7 +601,13 @@"zod-to-json-schema": ["[email protected]", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],- "@ai-sdk/provider-utils/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-sj9DWTJ2Ze0WR9qsiOPqoqzNx3OxL6iMxHImbhvoe9qOspekbzxNDMiJ4TIGfYHYh9w4OmBjz3prvqhzTi96+Q=="],+ "@ai-sdk/gateway/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw=="],++ "@ai-sdk/google/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw=="],++ "@ai-sdk/openai/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw=="],++ "@ai-sdk/openai-compatible/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw=="],"@anthropic-ai/sdk/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg=="],@@ -615,6 +623,8 @@"@types/bun/bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="],+ "ai/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw=="],+"body-parser/content-type": ["[email protected]", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],"body-parser/type-is": ["[email protected]", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="],diff --git a/package.json b/package.jsonindex 8596f78620..3cab6425ca 100644--- a/package.json+++ b/package.json@@ -157,7 +157,7 @@]},"dependencies": {- "@ai-sdk/anthropic": "^3.0.71",+ "@ai-sdk/anthropic": "^3.0.125","@ai-sdk/google": "^3.0.64","@ai-sdk/openai": "^3.0.53","@ai-sdk/openai-compatible": "^2.0.41",@@ -207,7 +207,7 @@"license": "MIT","version": "0.60.31.0","overrides": {- "@ai-sdk/provider-utils": "4.0.33",+ "@ai-sdk/provider-utils": "4.0.56","@hono/node-server": "^2.0.5","fast-uri": "3.1.8","body-parser": "^2.3.0",diff --git a/src/core/ai/recipes/anthropic.ts b/src/core/ai/recipes/anthropic.tsindex a812b56aa2..a61b4b1a52 100644--- a/src/core/ai/recipes/anthropic.ts+++ b/src/core/ai/recipes/anthropic.ts@@ -29,6 +29,7 @@ export const anthropic: Recipe = {'claude-opus-5','claude-opus-4-8','claude-opus-4-7',+ 'claude-sonnet-5-5','claude-sonnet-5','claude-sonnet-4-6','claude-haiku-4-5-20251001',@@ -41,6 +42,7 @@ export const anthropic: Recipe = {'claude-fable-5-1': 1_000_000,'claude-opus-5-5': 1_000_000,'claude-opus-5': 1_000_000,+ 'claude-sonnet-5-5': 1_000_000,'claude-sonnet-5': 1_000_000,'claude-opus-4-8': 1_000_000,'claude-opus-4-7': 1_000_000,diff --git a/src/core/ai/recipes/claude-cli.ts b/src/core/ai/recipes/claude-cli.tsindex 4526aa8850..c89d00a34c 100644--- a/src/core/ai/recipes/claude-cli.ts+++ b/src/core/ai/recipes/claude-cli.ts@@ -59,6 +59,7 @@ export const claudeCli: Recipe = {'claude-opus-5','claude-opus-4-8','claude-opus-4-7',+ 'claude-sonnet-5-5','claude-sonnet-5','claude-sonnet-4-6',],@@ -79,6 +80,7 @@ export const claudeCli: Recipe = {'claude-opus-5','claude-opus-4-8','claude-opus-4-7',+ 'claude-sonnet-5-5','claude-sonnet-5','claude-sonnet-4-6','claude-haiku-4-5-20251001',diff --git a/src/core/brainstorm/judges.ts b/src/core/brainstorm/judges.tsindex 37dafb4d8d..b5f0c1da18 100644--- a/src/core/brainstorm/judges.ts+++ b/src/core/brainstorm/judges.ts@@ -65,6 +65,7 @@ export const ANTHROPIC_OUTPUT_CAPS: Record<string, number> = {'claude-fable-5-1': 64_000,'claude-opus-5-5': 32_000,'claude-opus-5': 32_000,+ 'claude-sonnet-5-5': 64_000,'claude-sonnet-5': 64_000,'claude-opus-4-8': 32_000,'claude-opus-4-7': 32_000,diff --git a/src/core/model-pricing.ts b/src/core/model-pricing.tsindex 8c53e7e18e..4ba6540a54 100644--- a/src/core/model-pricing.ts+++ b/src/core/model-pricing.ts@@ -110,11 +110,12 @@ export const CANONICAL_PRICING: Record<string, ModelPricing> = {'anthropic:claude-opus-4-8': anthro( 5.00, 25.00),'anthropic:claude-opus-4-7': anthro( 5.00, 25.00),'anthropic:claude-opus-4-6': anthro( 5.00, 25.00),- // Sonnet 5 (released 2026-06-29): same $3/$15 sticker as 4.6. The launch- // intro discount ($2/$10 through 2026-08-31) is deliberately NOT modeled —- // the table carries standard rates so estimates stay conservative and- // don't need a time-bombed edit when the promo lapses.- 'anthropic:claude-sonnet-5': anthro( 3.00, 15.00),+ // Sonnet 5 / 5.5: $2 in / $10 out. Anthropic made Sonnet 5's launch+ // price the standard rate — the scheduled 2026-09-01 increase to $3/$15+ // did not happen (pricing page footnote). Sonnet 5.5 (released+ // 2026-09-28) ships at the same rate.+ 'anthropic:claude-sonnet-5-5': anthro( 2.00, 10.00),+ 'anthropic:claude-sonnet-5': anthro( 2.00, 10.00),'anthropic:claude-sonnet-4-6': anthro( 3.00, 15.00),// Haiku 4.5 — both the dateless canonical id and the dated snapshot.'anthropic:claude-haiku-4-5': anthro( 1.00, 5.00),diff --git a/src/core/takes-quality-eval/pricing.ts b/src/core/takes-quality-eval/pricing.tsindex 8c29b40d4c..bc2a7783d4 100644--- a/src/core/takes-quality-eval/pricing.ts+++ b/src/core/takes-quality-eval/pricing.ts@@ -40,6 +40,7 @@ const SUPPORTED_MODELS = ['anthropic:claude-opus-5','anthropic:claude-opus-4-8','anthropic:claude-opus-4-7',+ 'anthropic:claude-sonnet-5-5','anthropic:claude-sonnet-5','anthropic:claude-sonnet-4-6','anthropic:claude-haiku-4-5',diff --git a/test/ai/anthropic-claude5-wire.test.ts b/test/ai/anthropic-claude5-wire.test.tsnew file mode 100644index 0000000000..4afd3b3a32--- /dev/null+++ b/test/ai/anthropic-claude5-wire.test.ts@@ -0,0 +1,82 @@+/**+ * Claude 5-generation request shape on the native Anthropic lane (#5688, #5690).+ *+ * Opus 5.5 and Sonnet 5.5 reject a forced `tool_choice` (`any` / `tool`) with a+ * 400, and every Claude model from Opus 4.7 / Sonnet 5 on rejects `temperature`+ * ("`temperature` is deprecated for this model"). `@ai-sdk/[email protected]`+ * did not know any Claude 5 id, so it treated them as unknown models: it sent+ * `temperature` verbatim (decide, facts relink and brainstorm pin one) and+ * emulated `expand()`'s structured output with a forced `json` tool. Both calls+ * then 400 against the real API.+ *+ * These tests drive the real gateway (`chat()` and `expand()`) against a local+ * stub of the Messages API and assert the request body that leaves gbrain.+ */++import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'bun:test';+import { chat, configureGateway, expand, resetGateway } from '../../src/core/ai/gateway.ts';++let server: ReturnType<typeof Bun.serve>;+let bodies: any[] = [];++beforeAll(() => {+ server = Bun.serve({+ port: 0,+ hostname: '127.0.0.1',+ async fetch(req) {+ const body = await req.json();+ bodies.push(body);+ const structured = body.output_config?.format !== undefined;+ return Response.json({+ id: 'msg_stub',+ type: 'message',+ role: 'assistant',+ model: body.model,+ content: [{ type: 'text', text: structured ? '{"queries":["alpha one","alpha two"]}' : 'ok' }],+ stop_reason: 'end_turn',+ usage: { input_tokens: 1, output_tokens: 1 },+ });+ },+ });+});++afterAll(() => {+ server.stop(true);+ resetGateway();+});++beforeEach(() => {+ bodies = [];+ resetGateway();+});++function configure(model: string): void {+ configureGateway({+ chat_model: `anthropic:${model}`,+ expansion_model: `anthropic:${model}`,+ env: { ANTHROPIC_API_KEY: 'stub-key', ANTHROPIC_BASE_URL: `http://127.0.0.1:${server.port}/v1` },+ });+}++describe('Claude 5-generation models on the native Anthropic lane', () => {+ for (const model of ['claude-opus-5-5', 'claude-sonnet-5-5', 'claude-opus-5', 'claude-sonnet-5', 'claude-opus-4-8']) {+ test(`${model}: chat() drops temperature instead of sending a field the model rejects`, async () => {+ configure(model);+ await chat({ model: `anthropic:${model}`, messages: [{ role: 'user', content: 'hi' }], temperature: 0, maxTokens: 16 });+ expect(bodies).toHaveLength(1);+ expect(bodies[0].model).toBe(model);+ expect('temperature' in bodies[0]).toBe(false);+ });+ }++ for (const model of ['claude-opus-5-5', 'claude-sonnet-5-5']) {+ test(`${model}: expand() uses native structured output, never a forced tool_choice`, async () => {+ configure(model);+ const out = await expand('alpha');+ expect(bodies).toHaveLength(1);+ expect(bodies[0].tool_choice).toBeUndefined();+ expect(bodies[0].output_config?.format?.type).toBe('json_schema');+ expect(out).toEqual(expect.arrayContaining(['alpha one', 'alpha two']));+ });+ }+});diff --git a/test/ai/anthropic-model-ids.test.ts b/test/ai/anthropic-model-ids.test.tsindex 426f785a4d..bf8248b6d7 100644--- a/test/ai/anthropic-model-ids.test.ts+++ b/test/ai/anthropic-model-ids.test.ts@@ -46,8 +46,10 @@ describe('compareAnthropicVersions', () => {describe('newerAnthropicModel', () => {test('returns the newest priced same-family recipe id when the model is older', () => {- expect(newerAnthropicModel('anthropic:claude-sonnet-4-6')?.id).toBe('claude-sonnet-5');+ expect(newerAnthropicModel('anthropic:claude-sonnet-4-6')?.id).toBe('claude-sonnet-5-5');+ expect(newerAnthropicModel('anthropic:claude-sonnet-5')?.id).toBe('claude-sonnet-5-5');expect(newerAnthropicModel('anthropic:claude-opus-4-7')?.id).toBe('claude-opus-5-5');+ expect(newerAnthropicModel('anthropic:claude-opus-5')?.id).toBe('claude-opus-5-5');});test('dated and undated forms of the current version get no hint', () => {@@ -57,7 +59,7 @@ describe('newerAnthropicModel', () => {test('current, newer-than-recipe, fable, non-Anthropic and unparseable ids get none', () => {for (const id of [- 'anthropic:claude-sonnet-5',+ 'anthropic:claude-sonnet-5-5','anthropic:claude-sonnet-6','anthropic:claude-opus-5-5','anthropic:claude-opus-5-6',diff --git a/test/model-pricing.test.ts b/test/model-pricing.test.tsindex a048af5bda..f716dfc09a 100644--- a/test/model-pricing.test.ts+++ b/test/model-pricing.test.ts@@ -50,8 +50,9 @@ describe('CANONICAL_PRICING — table integrity', () => {expect(CANONICAL_PRICING['anthropic:claude-opus-4-7']).toMatchObject({ input: 5.0, output: 25.0 });});- test('Sonnet 5 present at $3/$15 (standard rate, intro discount not modeled)', () => {- expect(CANONICAL_PRICING['anthropic:claude-sonnet-5']).toMatchObject({ input: 3.0, output: 15.0 });+ test('Sonnet 5 and 5.5 present at $2/$10 (launch price became the standard rate)', () => {+ expect(CANONICAL_PRICING['anthropic:claude-sonnet-5']).toMatchObject({ input: 2.0, output: 10.0 });+ expect(CANONICAL_PRICING['anthropic:claude-sonnet-5-5']).toMatchObject({ input: 2.0, output: 10.0, cache_read: 0.2 });});test('Fable 5 present at $10/$50', () => {diff --git a/test/models-newer-hint.serial.test.ts b/test/models-newer-hint.serial.test.tsindex 07d0387fb2..47949efaef 100644--- a/test/models-newer-hint.serial.test.ts+++ b/test/models-newer-hint.serial.test.ts@@ -63,19 +63,19 @@ describe('gbrain models — newer-available hint', () => {const report = await reportOf(engine);expect(report.tiers.reasoning.newer_available).toEqual({family: 'sonnet',- model: 'claude-sonnet-5',- command: 'gbrain config set models.tier.reasoning anthropic:claude-sonnet-5',+ model: 'claude-sonnet-5-5',+ command: 'gbrain config set models.tier.reasoning anthropic:claude-sonnet-5-5',});const text = await capture(engine, []);const row = text.split('\n').find((l) => l.includes('tier.reasoning'))!;- expect(row).toContain('[newer sonnet available: claude-sonnet-5]');- expect(row).toContain('gbrain config set models.tier.reasoning anthropic:claude-sonnet-5');+ expect(row).toContain('[newer sonnet available: claude-sonnet-5-5]');+ expect(row).toContain('gbrain config set models.tier.reasoning anthropic:claude-sonnet-5-5');});test('current, newer-than-recipe, dated/undated-equal and non-Anthropic models get no hint', async () => {const engine = new StubConfigEngine();- engine.set('models.tier.reasoning', 'anthropic:claude-sonnet-5');+ engine.set('models.tier.reasoning', 'anthropic:claude-sonnet-5-5');engine.set('models.tier.deep', 'anthropic:claude-opus-6');engine.set('models.tier.utility', 'claude-haiku-4-5');engine.set('models.tier.subagent', 'openai:gpt-5.6');@@ -94,7 +94,7 @@ describe('gbrain models — newer-available hint', () => {const report = await reportOf(engine);const drift = report.per_task.find((r) => r.key === 'models.drift')!;- expect(drift.newer_available?.command).toBe('gbrain config set models.drift anthropic:claude-sonnet-5');+ expect(drift.newer_available?.command).toBe('gbrain config set models.drift anthropic:claude-sonnet-5-5');const think = report.per_task.find((r) => r.key === 'models.think')!;expect(think.resolved).toBe('anthropic:claude-opus-4-7');expect(think.newer_available).toBeUndefined();diff --git a/test/think-cost.test.ts b/test/think-cost.test.tsindex cbb8540f4f..87318c240a 100644--- a/test/think-cost.test.ts+++ b/test/think-cost.test.ts@@ -13,8 +13,8 @@ describe('computeThinkCostUsd', () => {{ input_tokens: 1_000_000, output_tokens: 1_000_000 },'anthropic:claude-sonnet-5',);- // sonnet-5 pricing: input $3.00/MTok, output $15.00/MTok.- expect(cost).toBe(18);+ // sonnet-5 pricing: input $2.00/MTok, output $10.00/MTok.+ expect(cost).toBe(12);});test('undefined usage (no-client/stub path) → undefined, never a fabricated cost', () => {