Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(providers): refresh Grok 4.7 catalog and pricing (#7926)
[._.]/ Adam Eivy4b48e41d9ef1
diff --git a/data.reference/model-comparison.json b/data.reference/model-comparison.jsonindex f5338f7002..bb7f41ebc3 100644--- a/data.reference/model-comparison.json+++ b/data.reference/model-comparison.json@@ -12354,6 +12354,70 @@"tokensPerSecond": null,"quota": null,"notes": "Publisher-reported agentic-coding evaluation of the released weights, not a measurement of the quantized GGUF build PortOS installs or of this machine. Scores are only comparable to another row whose scaffold, turn budget and sampling settings match — read the configuration field before ranking two models against each other. Cohere's release table mixes its own runs with public reports and Artificial Analysis values and is not one uniform evaluation; Cohere separately headlines 80.2 pass@10 on an SFT checkpoint, which is a different measurement."+ },+ {+ "id": "xai-grok-4.7-pricing-2026-09-21-standard",+ "provider": "xAI",+ "model": "grok-4.7",+ "effort": "unspecified",+ "configuration": "xAI API grok-4.7; input context at most 200,000 tokens",+ "billing": "api",+ "benchmark": "Official API pricing (2026-09-21)",+ "quality": null,+ "costPerTask": null,+ "inputPerMillion": {+ "value": 2,+ "source": {+ "url": "https://docs.x.ai/developers/models/grok-4.7",+ "retrievedAt": "2026-09-21T00:00:00Z",+ "methodology": "Official xAI Grok 4.7 model documentation; published USD per million tokens for this context tier. No benchmark or runtime measurement."+ }+ },+ "outputPerMillion": {+ "value": 6,+ "source": {+ "url": "https://docs.x.ai/developers/models/grok-4.7",+ "retrievedAt": "2026-09-21T00:00:00Z",+ "methodology": "Official xAI Grok 4.7 model documentation; published USD per million tokens for this context tier. No benchmark or runtime measurement."+ }+ },+ "reasoningPerMillion": null,+ "responseSeconds": null,+ "tokensPerSecond": null,+ "quota": null,+ "notes": "Cached input is $0.50/M for this tier. Text and image input, text output; function calling and structured output supported. Reasoning efforts low, medium, high and xhigh; default high. No Grok 4.6 quality or speed measurements transferred. Grok Build subscription quota and fast-variant pricing are not represented."+ },+ {+ "id": "xai-grok-4.7-pricing-2026-09-21-long-context",+ "provider": "xAI",+ "model": "grok-4.7",+ "effort": "unspecified",+ "configuration": "xAI API grok-4.7; input context above 200,000 tokens, up to 500,000",+ "billing": "api",+ "benchmark": "Official API pricing (2026-09-21)",+ "quality": null,+ "costPerTask": null,+ "inputPerMillion": {+ "value": 4,+ "source": {+ "url": "https://docs.x.ai/developers/models/grok-4.7",+ "retrievedAt": "2026-09-21T00:00:00Z",+ "methodology": "Official xAI Grok 4.7 model documentation; published USD per million tokens for this context tier. No benchmark or runtime measurement."+ }+ },+ "outputPerMillion": {+ "value": 12,+ "source": {+ "url": "https://docs.x.ai/developers/models/grok-4.7",+ "retrievedAt": "2026-09-21T00:00:00Z",+ "methodology": "Official xAI Grok 4.7 model documentation; published USD per million tokens for this context tier. No benchmark or runtime measurement."+ }+ },+ "reasoningPerMillion": null,+ "responseSeconds": null,+ "tokensPerSecond": null,+ "quota": null,+ "notes": "Cached input is $1.00/M for this tier. Text and image input, text output; function calling and structured output supported. Reasoning efforts low, medium, high and xhigh; default high. No Grok 4.6 quality or speed measurements transferred. Grok Build subscription quota and fast-variant pricing are not represented."}]}diff --git a/data.reference/providers.json b/data.reference/providers.jsonindex b0ff988f42..95b0396e59 100644--- a/data.reference/providers.json+++ b/data.reference/providers.json@@ -1098,16 +1098,18 @@"endpoint": "https://api.x.ai/v1","apiKey": "","models": [+ "grok-4.7","grok-4","grok-3","grok-3-mini","grok-code-fast-1"],- "defaultModel": "grok-4",+ "defaultModel": "grok-4.7","lightModel": "grok-3-mini","mediumModel": "grok-3",- "heavyModel": "grok-4",+ "heavyModel": "grok-4.7","fallbackProvider": null,+ "contextWindow": 500000,"timeout": 300000,"enabled": false,"envVars": {},@@ -1120,12 +1122,14 @@"command": "grok","args": [],"models": [- "grok-4.6"+ "grok-4.7",+ "grok-4.6",+ "grok-4.5"],- "defaultModel": "grok-4.6",- "lightModel": "grok-4.6",- "mediumModel": "grok-4.6",- "heavyModel": "grok-4.6",+ "defaultModel": "grok-4.7",+ "lightModel": "grok-4.7",+ "mediumModel": "grok-4.7",+ "heavyModel": "grok-4.7","contextWindow": 256000,"timeout": 300000,"enabled": false,@@ -1139,12 +1143,14 @@"command": "grok","args": [],"models": [- "grok-4.6"+ "grok-4.7",+ "grok-4.6",+ "grok-4.5"],- "defaultModel": "grok-4.6",- "lightModel": "grok-4.6",- "mediumModel": "grok-4.6",- "heavyModel": "grok-4.6",+ "defaultModel": "grok-4.7",+ "lightModel": "grok-4.7",+ "mediumModel": "grok-4.7",+ "heavyModel": "grok-4.7","contextWindow": 256000,"timeout": 600000,"enabled": false,diff --git a/docs/MODEL-COMPARISON.md b/docs/MODEL-COMPARISON.mdindex 864e5edeef..be343dda6e 100644--- a/docs/MODEL-COMPARISON.md+++ b/docs/MODEL-COMPARISON.md@@ -13,6 +13,19 @@ The catalog contains comprehensive public configurations across major providers- Every metric carries its own source URL, retrieval date and methodology. End-to-end response measurements must name input/output lengths, reasoning inclusion and percentile/window. They are independent of the intelligence evaluation. Unknown metrics are `null`.- Entries older than 30 days are visibly stale. This is a freshness cue, not a guarantee that more recent data is correct. A schema validates structure, not the source's truth.+## Grok 4.7 — September 21, 2026++[xAI announced Grok 4.7](https://x.ai/news/grok-4-7) for its API and Grok Build. The native `grok models` catalog lists `grok-4.7` as its default, alongside `grok-4.7-build-fast`, `grok-4.6` and `grok-4.5`. Fresh PortOS Grok CLI/TUI and xAI API presets default to 4.7; upgrades add the model without changing existing selections or custom arguments. Gateway model IDs remain specific to their own catalogs.++The [official model documentation](https://docs.x.ai/developers/models/grok-4.7) specifies a 500,000-token context window, text/image input, text output, function calling and structured outputs. API reasoning effort supports `low`, `medium`, `high` and `xhigh`, defaulting to `high`. These are API capabilities; PortOS's existing CLI context budget remains unchanged.++| Input context | Input USD/M | Cached input USD/M | Output USD/M |+| --- | ---: | ---: | ---: |+| At most 200,000 tokens | 2.00 | 0.50 | 6.00 |+| Above 200,000 tokens | 4.00 | 1.00 | 12.00 |++The comparison seed records these two pricing configurations with separate provenance. Grok 4.7 quality, measured speed, latency, cost per benchmark task and subscription quota remain unknown; historical Grok 4.6 evaluations retain their original identity. Usage estimates use the standard tier and disclose their approximation; they do not model the long-context surcharge. The fast variant is a separate offering and is not assigned these base-model prices in the comparison catalog.+## Research workflow1. Choose a browsing-capable CoS provider and model in the Comparison research panel and save. The `model-comparison-refresh` task ships **disabled and on-demand**; boot and page reads make no LLM calls.diff --git a/scripts/generate-provider-samples.js b/scripts/generate-provider-samples.jsindex fe1d5558f2..ede6ee9458 100644--- a/scripts/generate-provider-samples.js+++ b/scripts/generate-provider-samples.js@@ -533,7 +533,7 @@ const TUPLES = [{id: 'grok-cli', harnessId: 'grok', method: 'cli', service: 'grok-build',overrides: {- name: 'Grok Build CLI', models: ['grok-4.6'], defaultModel: 'grok-4.6', lightModel: 'grok-4.6', mediumModel: 'grok-4.6', heavyModel: 'grok-4.6',+ name: 'Grok Build CLI', models: ['grok-4.7', 'grok-4.6', 'grok-4.5'], defaultModel: 'grok-4.7', lightModel: 'grok-4.7', mediumModel: 'grok-4.7', heavyModel: 'grok-4.7',contextWindow: 256000, timeout: 300000, enabled: false,headlessArgs: OMIT,},@@ -541,7 +541,7 @@ const TUPLES = [{id: 'grok-tui', harnessId: 'grok', method: 'tui', service: 'grok-build',overrides: {- name: 'Grok Build TUI', models: ['grok-4.6'], defaultModel: 'grok-4.6', lightModel: 'grok-4.6', mediumModel: 'grok-4.6', heavyModel: 'grok-4.6',+ name: 'Grok Build TUI', models: ['grok-4.7', 'grok-4.6', 'grok-4.5'], defaultModel: 'grok-4.7', lightModel: 'grok-4.7', mediumModel: 'grok-4.7', heavyModel: 'grok-4.7',contextWindow: 256000, enabled: false,},},@@ -615,7 +615,8 @@ const TUPLES = [id: 'grok', harnessId: 'direct', method: 'api', service: { definitionId: 'xai', slug: 'grok', credentials: { apiKey: '' } },overrides: {name: 'xAI Grok', enabled: false,- models: ['grok-4', 'grok-3', 'grok-3-mini', 'grok-code-fast-1'], defaultModel: 'grok-4', lightModel: 'grok-3-mini', mediumModel: 'grok-3', heavyModel: 'grok-4',+ models: ['grok-4.7', 'grok-4', 'grok-3', 'grok-3-mini', 'grok-code-fast-1'], defaultModel: 'grok-4.7', lightModel: 'grok-3-mini', mediumModel: 'grok-3', heavyModel: 'grok-4.7',+ contextWindow: 500000,fallbackProvider: null, timeout: 300000, envVars: {}, apiKey: '',},},diff --git a/scripts/generate-provider-samples.test.js b/scripts/generate-provider-samples.test.jsindex 8ce34311f9..a0a80b767f 100644--- a/scripts/generate-provider-samples.test.js+++ b/scripts/generate-provider-samples.test.js@@ -26,6 +26,17 @@ const GENERATOR_PATH = join(HERE, 'generate-provider-samples.js');const REGENERATE_COMMAND = 'node scripts/generate-provider-samples.js';describe('provider sample generator', () => {+ it('offers Grok 4.7 on new installs while retaining selectable older generations', () => {+ const providers = buildProviders('reference');+ for (const id of ['grok', 'grok-cli', 'grok-tui']) {+ expect(providers[id].defaultModel).toBe('grok-4.7');+ expect(providers[id].models).toContain('grok-4.7');+ expect(providers[id].enabled).toBe(false);+ }+ expect(providers['grok-cli'].models).toContain('grok-4.6');+ expect(providers.grok.models).toContain('grok-4');+ expect(providers.grok.contextWindow).toBe(500000);+ });it('matches the committed toolkit sample byte-for-byte', () => {const committed = readFileSync(SAMPLE_PATH, 'utf8');const fresh = serializeDocument(buildDocument('sample'));diff --git a/scripts/migrations/404-grok-47-additive.js b/scripts/migrations/404-grok-47-additive.jsnew file mode 100644index 0000000000..25c7a54d43--- /dev/null+++ b/scripts/migrations/404-grok-47-additive.js@@ -0,0 +1,10 @@+/** Offer Grok 4.7 without replacing working model selections or custom args. */+import { makeAdditiveProviderInsertMigration } from './_lib.js';++export const TARGETS = [+ { id: 'grok-cli', retired: 'grok-4.6', current: 'grok-4.7' },+ { id: 'grok-tui', retired: 'grok-4.6', current: 'grok-4.7' },+ { id: 'grok', retired: 'grok-4', current: 'grok-4.7' },+];++export default makeAdditiveProviderInsertMigration({ targets: TARGETS, label: 'grok-4.7' });diff --git a/scripts/migrations/404-grok-47-additive.test.js b/scripts/migrations/404-grok-47-additive.test.jsnew file mode 100644index 0000000000..a74408ca4d--- /dev/null+++ b/scripts/migrations/404-grok-47-additive.test.js@@ -0,0 +1,7 @@+import { describe } from 'vitest';+import migration, { TARGETS } from './404-grok-47-additive.js';+import { runAdditiveProviderInsertMigrationTests } from './_testHelpers.js';++describe('migration 404 — offer Grok 4.7 while preserving configured selections', () => {+ runAdditiveProviderInsertMigrationTests({ migration, targets: TARGETS, prefix: 'migration-404-' });+});diff --git a/scripts/migrations/405-grok-47-comparison-coverage.js b/scripts/migrations/405-grok-47-comparison-coverage.jsnew file mode 100644index 0000000000..8b41fa642e--- /dev/null+++ b/scripts/migrations/405-grok-47-comparison-coverage.js@@ -0,0 +1,24 @@+/** Add sourced Grok 4.7 pricing rows without replacing an install's researched observations. */+import { readFile } from 'node:fs/promises';+import { join } from 'node:path';+import { atomicWrite } from '../../server/lib/fileCore.js';+import { modelComparisonImportSchema } from '../../server/lib/validation.js';++export default {+ async up({ rootDir }) {+ const path = join(rootDir, 'data/model-comparison.json');+ const raw = await readFile(path, 'utf8').catch(error => {+ if (error.code !== 'ENOENT') throw error;+ return null;+ });+ if (raw === null) return { added: 0 };+ const current = modelComparisonImportSchema.parse(JSON.parse(raw));+ const seed = modelComparisonImportSchema.parse(JSON.parse(await readFile(join(rootDir, 'data.reference/model-comparison.json'), 'utf8')));+ const ids = new Set(current.observations.map(row => row.id));+ const additions = seed.observations.filter(row => row.id.startsWith('xai-grok-4.7-pricing-2026-09-21-') && !ids.has(row.id));+ if (!additions.length) return { added: 0 };+ const result = modelComparisonImportSchema.parse({ ...current, observations: [...current.observations, ...additions] });+ await atomicWrite(path, result);+ return { added: additions.length };+ },+};diff --git a/scripts/migrations/405-grok-47-comparison-coverage.test.js b/scripts/migrations/405-grok-47-comparison-coverage.test.jsnew file mode 100644index 0000000000..3b41fd4a63--- /dev/null+++ b/scripts/migrations/405-grok-47-comparison-coverage.test.js@@ -0,0 +1,37 @@+import { afterEach, expect, it } from 'vitest';+import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';+import { tmpdir } from 'os';+import { join } from 'path';+import migration from './405-grok-47-comparison-coverage.js';++let rootDir;+afterEach(async () => { if (rootDir) await rm(rootDir, { recursive: true, force: true }); });++it('upgrades an existing catalog without losing researched evidence and fails closed on future versions', async () => {+ rootDir = await mkdtemp(join(tmpdir(), 'portos-grok47-seed-'));+ await mkdir(join(rootDir, 'data'));+ await mkdir(join(rootDir, 'data.reference'));+ const seed = JSON.parse(await readFile(new URL('../../data.reference/model-comparison.json', import.meta.url), 'utf8'));+ await writeFile(join(rootDir, 'data.reference/model-comparison.json'), JSON.stringify(seed));+ // No install catalog yet — a fresh install gets the seed through setup-data.+ expect(await migration.up({ rootDir })).toEqual({ added: 0 });++ // Seed CONTENT is asserted in scripts/prune-model-comparison-seed.test.js;+ // here it only has to be the set this migration backfills.+ const pricing = seed.observations.filter(row => row.id.startsWith('xai-grok-4.7-pricing-2026-09-21-'));+ expect(pricing).toHaveLength(2);++ const researched = { ...pricing[0], notes: 'Example locally researched evidence' };+ const prior = { schemaVersion: 1, observations: [seed.observations[0], researched] };+ const path = join(rootDir, 'data/model-comparison.json');+ await writeFile(path, JSON.stringify(prior));+ expect(await migration.up({ rootDir })).toEqual({ added: 1 });+ const result = JSON.parse(await readFile(path, 'utf8'));+ expect(result.observations.slice(0, 2)).toEqual(prior.observations);+ expect(await migration.up({ rootDir })).toEqual({ added: 0 });++ const future = JSON.stringify({ ...prior, schemaVersion: 99 });+ await writeFile(path, future);+ await expect(migration.up({ rootDir })).rejects.toThrow();+ expect(await readFile(path, 'utf8')).toBe(future);+});diff --git a/scripts/prune-model-comparison-seed.test.js b/scripts/prune-model-comparison-seed.test.jsindex 38ffd488e7..221153dd1b 100644--- a/scripts/prune-model-comparison-seed.test.js+++ b/scripts/prune-model-comparison-seed.test.js@@ -9,6 +9,15 @@ const root = join(import.meta.dirname, '..');const readSeed = async () => JSON.parse(await readFile(join(root, 'data.reference/model-comparison.json'), 'utf8'));describe('model comparison seed scope', () => {+ it('keeps Grok 4.7 context-tier prices distinct from historical benchmark measurements', async () => {+ const rows = (await readSeed()).observations.filter(row => row.model === 'grok-4.7');+ expect(rows.map(row => [row.inputPerMillion.value, row.outputPerMillion.value])).toEqual([[2, 6], [4, 12]]);+ expect(new Set(rows.map(row => row.configuration)).size).toBe(2);+ for (const row of rows) {+ expect(row.inputPerMillion.source.url).toBe('https://docs.x.ai/developers/models/grok-4.7');+ for (const metric of ['quality', 'costPerTask', 'reasoningPerMillion', 'responseSeconds', 'tokensPerSecond', 'quota']) expect(row[metric]).toBeNull();+ }+ });it('ships only models a shipped provider can dispatch', async () => {const [seed, scope] = await Promise.all([readSeed(), inScopeModels()]);const outOfScope = [...new Set(seed.observations.map(row => row.model))].filter(model => !scope.has(model));diff --git a/server/lib/aiToolkit/defaults/providers.sample.json b/server/lib/aiToolkit/defaults/providers.sample.jsonindex 887bd17e1e..2f9bcb96dd 100644--- a/server/lib/aiToolkit/defaults/providers.sample.json+++ b/server/lib/aiToolkit/defaults/providers.sample.json@@ -1095,16 +1095,18 @@"endpoint": "https://api.x.ai/v1","apiKey": "","models": [+ "grok-4.7","grok-4","grok-3","grok-3-mini","grok-code-fast-1"],- "defaultModel": "grok-4",+ "defaultModel": "grok-4.7","lightModel": "grok-3-mini","mediumModel": "grok-3",- "heavyModel": "grok-4",+ "heavyModel": "grok-4.7","fallbackProvider": null,+ "contextWindow": 500000,"timeout": 300000,"enabled": false,"envVars": {},@@ -1117,12 +1119,14 @@"command": "grok","args": [],"models": [- "grok-4.6"+ "grok-4.7",+ "grok-4.6",+ "grok-4.5"],- "defaultModel": "grok-4.6",- "lightModel": "grok-4.6",- "mediumModel": "grok-4.6",- "heavyModel": "grok-4.6",+ "defaultModel": "grok-4.7",+ "lightModel": "grok-4.7",+ "mediumModel": "grok-4.7",+ "heavyModel": "grok-4.7","contextWindow": 256000,"timeout": 300000,"enabled": false,@@ -1136,12 +1140,14 @@"command": "grok","args": [],"models": [- "grok-4.6"+ "grok-4.7",+ "grok-4.6",+ "grok-4.5"],- "defaultModel": "grok-4.6",- "lightModel": "grok-4.6",- "mediumModel": "grok-4.6",- "heavyModel": "grok-4.6",+ "defaultModel": "grok-4.7",+ "lightModel": "grok-4.7",+ "mediumModel": "grok-4.7",+ "heavyModel": "grok-4.7","contextWindow": 256000,"timeout": 600000,"enabled": false,diff --git a/server/lib/modelPricing.js b/server/lib/modelPricing.jsindex ff42ec4c1f..d292808fa1 100644--- a/server/lib/modelPricing.js+++ b/server/lib/modelPricing.js@@ -15,7 +15,7 @@* >90% of input volume, so pricing them at the standard input rate (or, as* PortOS did before #3124, not counting the tokens at all) is the single largest* source of error in the estimate. Verified against the official pricing pages- * on PRICING_AS_OF:+ * on PRICING_AS_OF, with newer model-specific verification noted below:* - https://platform.claude.com/docs/en/about-claude/pricing* - https://developers.openai.com/api/docs/pricing* - https://docs.x.ai/docs/pricing@@ -86,6 +86,10 @@ const EXACT_RATES = {'gpt-5.4-nano': [0.2, 1.25],'gpt-5.3-codex': [1.75, 14.0],// xAI+ // Verified 2026-09-21: https://docs.x.ai/developers/models/grok-4.7+ // Standard <=200k input tier; >200k uses $4/$12 and is not modeled here.+ 'grok-4.7': [2.0, 6.0],+ 'grok-4.6': [2.0, 6.0],'grok-4.5': [2.0, 6.0],'grok-4.3': [1.25, 2.5],'grok-build-0.1': [1.0, 2.0],@@ -140,7 +144,7 @@ const FAMILY_RULES = [{ test: /gpt/i, rateModel: 'gpt-5.4' },{ test: /grok-build/i, rateModel: 'grok-build-0.1' },{ test: /grok-4\.20/i, rateModel: 'grok-4.3' },- { test: /grok/i, rateModel: 'grok-4.5' },+ { test: /grok/i, rateModel: 'grok-4.7' },{ test: /gemini|antigravity/i, rateModel: 'gemini-3.1-pro-preview' },];@@ -148,7 +152,7 @@ const FAMILY_RULES = [const PROVIDER_DEFAULT_RULES = [{ test: /claude/i, rateModel: 'claude-sonnet-4-5' },{ test: /codex|openai/i, rateModel: 'gpt-5.3-codex' },- { test: /grok|xai/i, rateModel: 'grok-4.5' },+ { test: /grok|xai/i, rateModel: 'grok-4.7' },{ test: /antigravity|agy|gemini|google/i, rateModel: 'gemini-3.1-pro-preview' },// Cerebras hosts a small, uniformly cheap catalog; its flagship's rates are a// far better estimate for an unrecognized id (e.g. a preview model picked up@@ -172,8 +176,9 @@ const FALLBACK_RATES = { rateModel: null, inputPer1M: 3.0, outputPer1M: 15.0 };* Claude Code does not use — `cache_creation_input_tokens` is 5-minute).* - OpenAI: 0.1x cached input; only gpt-5.6 lists a separate cache-write rate* (~1.25x), and Codex reports no cache-write tokens at all.- * - xAI: cached prompt tokens run 0.15-0.20x depending on the model (0.15x on- * grok-4.5); no published cache-write surcharge.+ * - xAI: Grok 4.7's cached input is $0.50/M (0.25x), verified 2026-09-21;+ * Grok 4.5 retains its 0.15x estimate. No published cache-write surcharge+ * for Grok 4.7: uncached input uses its standard input rate.* - Google: 0.1x cached input, plus an hourly storage fee we do not model* (PortOS records no cache duration to price it against).*@@ -191,6 +196,7 @@ const FALLBACK_RATES = { rateModel: null, inputPer1M: 3.0, outputPer1M: 15.0 };*/const DEFAULT_CACHE_MULTIPLIERS = { read: 0.1, write: 1.25 };const CACHE_MULTIPLIER_RULES = [+ { test: /^grok-4\.7$/, read: 0.25, write: 1 },{ test: /^grok/, read: 0.15, write: 1.25 },{ test: /^claude-fable-5-1/, read: 0.025, write: 1.25 },];diff --git a/server/lib/modelPricing.test.js b/server/lib/modelPricing.test.jsindex d338341c33..9786551153 100644--- a/server/lib/modelPricing.test.js+++ b/server/lib/modelPricing.test.js@@ -95,7 +95,7 @@ describe('resolveModelRates', () => {it('resolves configured-default sentinels to their provider family', () => {expect(resolveModelRates('codex', 'codex-configured-default')).toMatchObject({ rateModel: 'gpt-5.3-codex', matched: 'family' });- expect(resolveModelRates('grok', 'grok-configured-default')).toMatchObject({ rateModel: 'grok-4.5', matched: 'family' });+ expect(resolveModelRates('grok', 'grok-configured-default')).toMatchObject({ rateModel: 'grok-4.7', matched: 'family' });expect(resolveModelRates('antigravity-cli', 'antigravity-configured-default')).toMatchObject({ rateModel: 'gemini-3.1-pro-preview', matched: 'family' });});@@ -273,6 +273,12 @@ describe('estimateCostUsd', () => {});describe('cache-tier rates on resolveModelRates', () => {+ it('estimates Grok 4.7 standard and cached tokens without changing historical Grok rates', () => {+ const rates = resolveModelRates('grok', 'grok-4.7');+ expect(rates).toMatchObject({ inputPer1M: 2, outputPer1M: 6, cacheReadPer1M: 0.5, cacheWritePer1M: 2, matched: 'exact' });+ expect(estimateCostUsd(100_000, 10_000, rates, { cacheReadTokens: 100_000 })).toBeCloseTo(0.31);+ expect(resolveModelRates('grok-cli', 'grok-4.6')).toMatchObject({ inputPer1M: 2, outputPer1M: 6, cacheReadPer1M: 0.3 });+ });it('derives both cache tiers from the input rate on every match tier', () => {for (const [providerId, model] of [['claude-code', 'claude-opus-5'], // exact