Skip to content
Source
Sign inSign up
TanStack/schemas

mistral: pricing_lost for voxtral-small-2507/-latest - docs model page 404 after Voxtral 3 launch #787 (GitHub #786)

Closedtombeckenham opened this issue 2 comments
tombeckenhamcommented

Symptom

pricing_lost parser_miss on every Mistral poll since 2026-11-27 15:52 UTC for voxtral-small-2507 and voxtral-small-latest (PostHog project 643425; 15:52 and 16:05 polls so far).

Cause

Both rows' stored card comes from https://docs.mistral.ai/models/voxtral-small-25-07 (factSources.pricing.sourceUrl, path Pricing). That page now 404s. Mistral launched Voxtral 3; the docs nav lists voxtral-small-transcribe-3-0 and a "Migrate from Voxtral 2" guide (/llms/studio/audio/migrate-from-voxtral-2/llms.txt), and no Voxtral Small 25.07 page. The /v1/models listing still returns the two ids, so the poll looks for a price and finds none.

Timing fits the 6h docs KV TTL after the #786 deploy (~10:10) expiring, so the cached page was served until ~15:50.

Expected

Fail loud, no fallback: find out what the source now states for these ids (the migration guide, the deprecations/lifecycle table, or the catalog __next_f payload read by mistral-catalog.ts). If the model is deprecated/retired with a stated date or replacement, write that (replacedBy, deprecation) and the price state the source supports (cleared only if the source visibly drops it; keep the stored card with unavailable if the page is simply gone and nothing states a change). Don't invent a price from Voxtral 3. Bump DOCS_CACHE_VERSION if a parser's output changes.

  1. tombeckenham assignedtombeckenham

  2. tombeckenham linked this to #788

  3. tanstack-sourcecommented Only here. This is not on GitHub.

    I reproduced the row-level symptom on main (01eabeb): the two Voxtral Small ids get no stated price absence, so the poll logs pricing_lost / parser_miss on every run.

    I could not reach docs.mistral.ai from the sandbox (egress blocked), so the repro stubs the docs pages. Everything else is the real code.

    What the code does

    1. mistralModelPricing (src/server/providers/mistral-pricing.ts) builds bySlug from the pricing table, then loads one page per slug.
    2. Ids the table does not cover are looked up in the overview's API-slug map, then in the models index (mistralIndexSlugFor).
    3. voxtral-small-2507 matches neither: the overview pairs no API id with /models/voxtral-small-25-07, and the index no longer links that slug. So no page is fetched for it.
    4. The lookup returns {} for the id: no pricing, and no absent.pricing. absent.pricing = 'unavailable' is set only when a page was loaded and its markdown twin 404'd (priceUnread).
    5. observePricingWrite (src/server/ingest/ingest-signals.ts) sees a null price with a stored card and no stated reason, so it keeps the card and emits pricing_lost with reason: 'parser_miss'.

    The repro also shows the other branch: when the overview still names the id and its page 404s, the whole pricing load throws (fetch failed: … → 404). tryDocs then reports one docsFailures entry and marks every row pricing: 'unavailable'. That is a loud failure, not the per-row pricing_lost the issue reports, so the reported polls take the silent branch above.

    Suspected files

    • src/server/providers/mistral-pricing.ts: lookup sets absent.pricing only from priceUnread; an id no fetched page names gets no entry at all.
    • src/server/providers/adapters/mistral.ts: clearUnpriced and the unavailable(...) fallback only cover a failed load, not an id the docs stopped naming.
    • src/server/ingest/ingest-signals.ts: observePricingWrite turns that silence into a per-row pricing_lost failure.

    DOCS_CACHE_VERSION is v53; no parser output changes in this repro, so no bump is needed for it.

    Repro

    Path: repro/issue-787.test.mjs Command: node --experimental-transform-types --test repro/issue-787.test.mjs

    // Repro for issue #787.
    //
    // Mistral's `GET /v1/models` still lists `voxtral-small-2507` and
    // `voxtral-small-latest`, but the docs drop the model: no pricing-table row,
    // no overview row, no index slug, so `/models/voxtral-small-25-07` is never
    // fetched. The pricing lookup then says nothing at all about the price, and
    // the poll logs `pricing_lost` / `parser_miss` on every run.
    //
    // docs.mistral.ai is not reachable from this sandbox, so the docs are
    // stubbed with that state. Everything else is the real code.
    import assert from 'node:assert/strict'
    import { registerHooks } from 'node:module'
    import { join } from 'node:path'
    import { test } from 'node:test'
    import { pathToFileURL } from 'node:url'
    
    const root = join(new URL('..', import.meta.url).pathname)
    
    registerHooks({
      resolve(specifier, context, nextResolve) {
        if (specifier.startsWith('#/')) {
          return {
            url: pathToFileURL(join(root, 'src', specifier.slice(2))).href,
            shortCircuit: true,
          }
        }
        if (specifier.startsWith('@modelschemas/rate-card')) {
          return {
            url: pathToFileURL(join(root, 'packages/rate-card/src/index.ts')).href,
            shortCircuit: true,
          }
        }
        if (specifier.endsWith('.js')) {
          try {
            return nextResolve(specifier, context)
          } catch (error) {
            if (error?.code !== 'ERR_MODULE_NOT_FOUND') throw error
            return nextResolve(`${specifier.slice(0, -3)}.ts`, context)
          }
        }
        return nextResolve(specifier, context)
      },
    })
    
    const load = (path) => import(pathToFileURL(join(root, path)).href)
    
    const { mistralModelPricing } = await load(
      'src/server/providers/mistral-pricing.ts',
    )
    const { observePricingWrite } = await load(
      'src/server/ingest/ingest-signals.ts',
    )
    const { mistralModelPage, tip, MISTRAL_WEBSEARCH_GUIDE } = await load(
      'src/server/providers/fixtures/mistral-model-page.ts',
    )
    
    // `docs.mistral.ai/models` after Voxtral 3: the overview table and its index
    // links name Voxtral Small Transcribe 3 and no Voxtral Small 25.07.
    const MODELS_PAGE = [
      '| Model | API name | Status | Context | Summary |',
      '| --- | --- | --- | --- | --- |',
      '| [Mistral Small 4](/models/mistral-small-4-0-26-03) | `mistral-small-2603` | GA | 256k | Hybrid model. |',
      '| [Voxtral Small Transcribe 3](/models/voxtral-small-transcribe-3-0) | `voxtral-small-transcribe-3-0` | Public Preview | 32k | Transcription. |',
      '',
      '## Deprecated and retired models',
      '',
      '| Model | API name | Status | Context | Summary | Deprecation | Retirement | Replacement |',
      '| --- | --- | --- | --- | --- | --- | --- | --- |',
      '| [Z.ai GLM 5.2](/models/zai-glm-5-2) | `zai-glm-5-2` | Deprecated | 1M | Third-party. | 2026-09-29 | 2026-10-31 | [Z.ai GLM 5.3](/models/zai-glm-5-3) |',
      '',
    ].join('\n')
    
    const DOCS = {
      // The token table prices Mistral Small 4 and no Voxtral row.
      'https://docs.mistral.ai/inference/pricing': `<h2>Flagship models</h2>
    <p>Prices /M Tokens</p>
    <table>
    <tr><td><a href="/models/mistral-small-4-0-26-03">Small</a></td><td>$0.15</td><td>—</td><td>$0.6</td></tr>
    </table>`,
      'https://docs.mistral.ai/resources/changelogs': '',
      'https://docs.mistral.ai/models': MODELS_PAGE,
      'https://docs.mistral.ai/models/mistral-small-4-0-26-03': mistralModelPage(
        ['mistral-small-2603'],
        [[tip('Text input'), tip('Text output')]],
      ),
      'https://docs.mistral.ai/models/mistral-small-4-0-26-03.md':
        '- Release date: 2026-03-16\n- Pricing: Input $0.15 /M Tokens; Output $0.6 /M Tokens\n',
      'https://docs.mistral.ai/llms/studio/agents/agent-tools/websearch/llms.txt':
        MISTRAL_WEBSEARCH_GUIDE,
    }
    
    const original = globalThis.fetch
    const fetched = []
    globalThis.fetch = ((url) => {
      fetched.push(String(url))
      const body = DOCS[String(url)]
      return Promise.resolve(
        body === undefined
          ? new Response('not found', { status: 404 })
          : new Response(body),
      )
    })
    
    const LISTED = [
      'mistral-small-2603',
      'voxtral-small-2507',
      'voxtral-small-latest',
    ]
    let lookup
    try {
      lookup = await mistralModelPricing(undefined, LISTED)
    } finally {
      globalThis.fetch = original
    }
    
    test('the poll never fetches the voxtral-small page', () => {
      assert.equal(
        fetched.some((url) => url.includes('voxtral-small-25-07')),
        false,
      )
    })
    
    test('a listed id no docs source names states no price absence', () => {
      const facts = lookup('voxtral-small-2507')
      console.log('lookup facts:', JSON.stringify(facts))
      // No price is invented from Voxtral 3, and the id stays out of `seen`.
      assert.equal(facts.pricing, undefined)
      assert.equal(lookup.seen.has('voxtral-small-2507'), false)
      // The page is gone and nothing states a change: the issue asks for
      // `unavailable`, which keeps the stored card and stays quiet.
      assert.deepEqual(facts.absent, { pricing: 'unavailable' })
    })
    
    test('so the poll logs pricing_lost parser_miss on every run', () => {
      for (const rawId of ['voxtral-small-2507', 'voxtral-small-latest']) {
        const decision = observePricingWrite({
          providerId: 'mistral',
          rawId,
          incomingNull: lookup(rawId).pricing == null,
          hadStoredCard: true,
          keepExtracted: false,
          absent: lookup(rawId).absent?.pricing,
        })
        assert.deepEqual(
          decision.events.map((event) => event.event),
          ['pricing_lost'],
        )
        assert.deepEqual(decision.events[0]?.properties, {
          providerId: 'mistral',
          rawId,
          reason: 'parser_miss',
        })
      }
    })

    Output (end):

    lookup facts: {}
    ✔ the poll never fetches the voxtral-small page (3.469752ms)
    ✖ a listed id no docs source names states no price absence (7.464274ms)
    ✔ so the poll logs pricing_lost parser_miss on every run (1.48531ms)
    ℹ tests 3
    ℹ suites 0
    ℹ pass 2
    ℹ fail 1
    ℹ cancelled 0
    ℹ skipped 0
    ℹ todo 0
    ℹ duration_ms 1568.775749
    
    ✖ failing tests:
    
    test at repro/issue-787.test.mjs:123:1
    ✖ a listed id no docs source names states no price absence (7.464274ms)
      AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
      + undefined
      - {
      -   pricing: 'unavailable'
      - }
      actual: undefined,
      expected: { pricing: 'unavailable' },

    TanStack Source bot, investigate agent

  4. Fixed by #788 (merged as d7c1d5d, deployed 2026-11-27 16:41). No Mistral pricing_lost since the 16:48 poll.

  5. tombeckenham closed this

Sign in to join this conversation.