diff --git a/docs/native-reasoning-sources.md b/docs/native-reasoning-sources.md
index 2676854e..a7a0063c 100644
--- a/docs/native-reasoning-sources.md
+++ b/docs/native-reasoning-sources.md
@@ -100,16 +100,24 @@ source URL, fixture or output; they make no inference calls.
## Mistral
-https://docs.mistral.ai/studio/conversations/reasoning.md
+https://docs.mistral.ai/inference/conversations/reasoning
+
+Checked 2026-11-19. `llms.txt` links the `.md` twin of this page, and the old
+`/studio/conversations/reasoning.md` path redirects to that twin, but the twin
+404s. The HTML page is the guide.
The guide scopes adjustable reasoning to named model IDs, followed by a normative
parameter-value section describing high and none. These values apply to that
-scope, while its explicit zai-glm-5-3 low/high/max list overrides them. Code
-assignments alone do not establish the values. The existing adapter retains native
-API alias relationships when copying these facts; no sibling relationships are
-invented. Models outside the guide's scope do not inherit its controls. Fenced
-examples cannot expand the normative values. The GLM always-thinking note
-explicitly establishes mandatory=true; a value list alone leaves it null.
+scope, while its explicit zai-glm-5-3 low/high/max list overrides them. A bullet
+that names its own levels (Supports `low`, `medium`, and `high` reasoning
+effort) is that model's list. Mistral Large 4's section says it always reasons,
+so `mistral-large-4` and `mistral-large-4-0` are mandatory. Code assignments
+alone do not establish the values. The existing adapter retains native API alias
+relationships when copying these facts; no sibling relationships are invented.
+Models outside the guide's scope do not inherit its controls. Fenced examples
+cannot expand the normative values. The GLM always-thinking note explicitly
+establishes mandatory=true; a value list alone leaves it null. A rendered HTML
+page is read as the same markdown shape.
## Dashscope
diff --git a/src/server/providers/adapters/mistral.test.ts b/src/server/providers/adapters/mistral.test.ts
index ee57124a..fbb4c6e7 100644
--- a/src/server/providers/adapters/mistral.test.ts
+++ b/src/server/providers/adapters/mistral.test.ts
@@ -9,6 +9,8 @@ import {
} from '../fixtures/mistral-model-page.ts'
import { provider } from './mistral.ts'
import { MISTRAL_DEPRECATIONS_URL } from '../deprecations.ts'
+import { MISTRAL_WEBSEARCH_URL } from '../mistral-pricing.ts'
+import { MISTRAL_REASONING_URL } from '../reasoning-config.ts'
const MODELS_PAGE = readFileSync(
new URL('../fixtures/mistral-models.md.txt', import.meta.url),
@@ -145,8 +147,7 @@ describe('mistral listModels modalities', () => {
| Small | $0.1 | — | $0.3 |
`,
'https://docs.mistral.ai/resources/changelogs': '',
- 'https://docs.mistral.ai/studio/agents/agent-tools/websearch.md':
- MISTRAL_WEBSEARCH_GUIDE,
+ [MISTRAL_WEBSEARCH_URL]: MISTRAL_WEBSEARCH_GUIDE,
'https://docs.mistral.ai/models/mistral-small-4-0-26-03':
mistralModelPage(
['mistral-small-2603', 'mistral-small-latest'],
@@ -159,7 +160,7 @@ describe('mistral listModels modalities', () => {
],
],
),
- 'https://docs.mistral.ai/studio/conversations/reasoning.md':
+ [MISTRAL_REASONING_URL]:
'- `mistral-small-latest`: Supports adjustable reasoning via the `reasoning_effort` parameter.',
'https://docs.mistral.ai/models':
'x',
@@ -281,7 +282,7 @@ describe('mistral listModels docs failures', () => {
expect(docsFailures?.first.map((failure) => failure.source)).toEqual(
expect.arrayContaining([
'https://docs.mistral.ai/inference/pricing',
- 'https://docs.mistral.ai/studio/conversations/reasoning.md',
+ MISTRAL_REASONING_URL,
]),
)
} finally {
diff --git a/src/server/providers/mistral-pricing.test.ts b/src/server/providers/mistral-pricing.test.ts
index 79984b73..4cd094e5 100644
--- a/src/server/providers/mistral-pricing.test.ts
+++ b/src/server/providers/mistral-pricing.test.ts
@@ -26,6 +26,7 @@ import {
parseMistralPricing,
parseMistralSamePrice,
parseMistralWebSearchTools,
+ MISTRAL_WEBSEARCH_URL,
withDocumentInput,
} from './mistral-pricing.ts'
@@ -755,8 +756,7 @@ describe('mistral model page price and max output', () => {
),
'https://docs.mistral.ai/models/mistral-medium-3-5-26-04.md':
'- Pricing: Input $1.5 /M Tokens; Output $7.5 /M Tokens\n',
- 'https://docs.mistral.ai/studio/agents/agent-tools/websearch.md':
- MISTRAL_WEBSEARCH_GUIDE,
+ [MISTRAL_WEBSEARCH_URL]: MISTRAL_WEBSEARCH_GUIDE,
}
globalThis.fetch = ((url: string) => {
const body = docs[String(url)]
@@ -830,8 +830,7 @@ describe('mistral model page price and max output', () => {
),
'https://docs.mistral.ai/models/leanstral-1-5.md':
'- Pricing: Free; Input $0 /M Tokens; Output $0 /M Tokens\n',
- 'https://docs.mistral.ai/studio/agents/agent-tools/websearch.md':
- MISTRAL_WEBSEARCH_GUIDE,
+ [MISTRAL_WEBSEARCH_URL]: MISTRAL_WEBSEARCH_GUIDE,
}
globalThis.fetch = ((url: string) => {
const body = docs[String(url)]
@@ -1029,6 +1028,27 @@ describe('mistral web search tools', () => {
).toThrow('names no tool id')
})
+ it('reads the rendered guide and ignores later schema bullets', () => {
+ const html = `
+Our built-in tool for websearch allows any of our models to access the web at any point.
+There are two versions:
+
+web_search: A simple web search tool.
+web_search_premium: A more complex web search tool.
+
+web_search and web_search_premium work with the Conversations API (/v1/conversations).
+Response
+
+name: The name of the tool.
+type: The type of entry.
+
+`
+ expect(parseMistralWebSearchTools(html)).toEqual([
+ 'web_search',
+ 'web_search_premium',
+ ])
+ })
+
it('gives them only to a page that lists agents-conversations', () => {
const tools = ['web_search', 'web_search_premium']
expect(mistralConversationTools(['agents-conversations'], tools)).toEqual(
diff --git a/src/server/providers/mistral-pricing.ts b/src/server/providers/mistral-pricing.ts
index edee4b70..1645cbb3 100644
--- a/src/server/providers/mistral-pricing.ts
+++ b/src/server/providers/mistral-pricing.ts
@@ -38,6 +38,7 @@ import type { Expr, RateCard } from '@modelschemas/rate-card'
import { MISTRAL_DEPRECATIONS_URL } from './deprecations.ts'
import { tagDocsFacts } from './fact-sources.ts'
import { assertParsed, cachedDocs, mapConcurrent } from './model-facts.ts'
+import { mistralDocsMarkdown } from './reasoning-config.ts'
import { parseMistralPageTools } from './server-tools.ts'
import { fetchText, sha256Text } from './types.ts'
import type { FactSource, ModelInfo } from './types.ts'
@@ -1234,29 +1235,42 @@ export interface MistralPricingLookup {
seen: ReadonlySet
}
+/**
+ * The rendered web-search guide. `llms.txt` still links
+ * `https://docs.mistral.ai/studio/agents/agent-tools/websearch.md`, which
+ * 404s (checked 2026-11-19). This HTML page is what serves the guide.
+ */
export const MISTRAL_WEBSEARCH_URL =
- 'https://docs.mistral.ai/studio/agents/agent-tools/websearch.md'
+ 'https://docs.mistral.ai/studio/agents/agent-tools/websearch'
/**
* The web search guide's tool ids (#409). It states the tool "allows any
* of our models to access the web" and that it works with the
* Conversations API (`/v1/conversations`), not Chat Completions; the ids
- * are the bullets under "There are two versions:". Without the any-model
+ * are the bullets directly under "There are two versions:". Later schema
+ * bullets (`name`, `type`, …) are not tool ids. Without the any-model
* sentence, the Conversations scope, or an id, it throws. Mistral's other
* built-in tools (code interpreter, image generation, libraries) make no
* any-model statement, so they are not read.
*/
export function parseMistralWebSearchTools(markdown: string): Array {
- if (!/allows any of our models to access the web/.test(markdown)) {
+ const page = mistralDocsMarkdown(markdown)
+ if (!/allows any of our models to access the web/.test(page)) {
throw new Error('mistral websearch guide: no any-model statement')
}
- if (!/work with the \[Conversations API\]/.test(markdown)) {
+ if (!/work with the \[Conversations API\]/.test(page)) {
throw new Error('mistral websearch guide: no Conversations API scope')
}
- const versions = markdown.split(/^There are two versions:$/m)[1] ?? ''
- const ids = [...versions.matchAll(/^- `([a-z][a-z0-9_]*)`:/gm)].map(
- (match) => match[1] ?? '',
- )
+ const versions = page.split(/^There are two versions:$/m)[1] ?? ''
+ const ids: Array = []
+ for (const line of versions.split('\n')) {
+ const match = /^- `([a-z][a-z0-9_]*)`:/.exec(line)
+ if (match?.[1]) {
+ ids.push(match[1])
+ continue
+ }
+ if (ids.length > 0 && line.trim() !== '') break
+ }
if (ids.length === 0) {
throw new Error('mistral websearch guide: names no tool id')
}
diff --git a/src/server/providers/reasoning-config.test.ts b/src/server/providers/reasoning-config.test.ts
index 8f69027a..4e971e3d 100644
--- a/src/server/providers/reasoning-config.test.ts
+++ b/src/server/providers/reasoning-config.test.ts
@@ -334,6 +334,58 @@ describe('parseMistralReasoning', () => {
undefined,
)
})
+
+ it('reads the rendered guide, including a model whose own levels replace the shared list', () => {
+ const html = `
+
+- Mistral Small 4 (
mistral-small-2603): Supports adjustable reasoning via the reasoning_effort parameter.
+- Mistral Medium 3.5 (
mistral-medium-3-5): Supports adjustable reasoning via the reasoning_effort parameter.
+- Mistral Large 4 (
mistral-large-4-0): Supports low, medium, and high reasoning effort.
+zai-glm-5-3: Supports adjustable reasoning via the reasoning_effort parameter. Supported values are low, high, and max (see note below).
+- GLM 5.3 Flash (
zai-glm-5-3-flash): Supports low, high, and max reasoning effort. none is not supported.
+
+The reasoning_effort parameter controls how much compute the model spends reasoning. For mistral-small-2603 and mistral-medium-3-5:
+
+reasoning_effort = "high": The response includes a full thinking chunk before the final answer.
+reasoning_effort = "none": The model thinks minimally and the thinking chunk is omitted from the response.
+
+zai-glm-5-3 supports low, high, and max — not none. message.content is always returned as a list of chunks (thinking + text).
+described in Handling thinking chunks.
+Mistral Large 4 reasoning effort
+Mistral Large 4 (mistral-large-4 / mistral-large-4-0) supports three reasoning levels:
+Mistral Large 4 always reasons, so no level matches none.
+Usage
+`
+ const parsed = parseMistralReasoning(html)
+ expect(parsed.get('mistral-small-2603')).toEqual({
+ mode: 'effort',
+ mandatory: false,
+ efforts: ['high', 'none'],
+ })
+ expect(parsed.get('mistral-medium-3-5')).toEqual({
+ mode: 'effort',
+ mandatory: false,
+ efforts: ['high', 'none'],
+ })
+ expect(parsed.get('zai-glm-5-3')).toEqual({
+ mode: 'effort',
+ mandatory: true,
+ efforts: ['low', 'high', 'max'],
+ })
+ expect(parsed.get('zai-glm-5-3-flash')).toEqual({
+ mode: 'effort',
+ mandatory: null,
+ efforts: ['low', 'high', 'max'],
+ })
+ expect(parsed.get('mistral-large-4-0')).toEqual({
+ mode: 'effort',
+ mandatory: true,
+ efforts: ['low', 'medium', 'high'],
+ })
+ expect(parsed.get('mistral-large-4')).toEqual(
+ parsed.get('mistral-large-4-0'),
+ )
+ })
})
describe('parseGroqReasoning', () => {
diff --git a/src/server/providers/reasoning-config.ts b/src/server/providers/reasoning-config.ts
index f7a7eec8..539b6e60 100644
--- a/src/server/providers/reasoning-config.ts
+++ b/src/server/providers/reasoning-config.ts
@@ -21,8 +21,61 @@ import type { ByteplusDoc } from './byteplus-pricing.ts'
import { fetchText, reasoningViolation, sha256Text } from './types.ts'
import type { ModelFactSources, ModelInfo, ModelReasoning } from './types.ts'
+/**
+ * The rendered reasoning guide. `https://docs.mistral.ai/llms.txt` links
+ * `https://docs.mistral.ai/inference/conversations/reasoning.md`, and the
+ * old `/studio/conversations/reasoning.md` redirects there, but that
+ * markdown twin 404s (checked 2026-11-19). This HTML page is what serves
+ * the guide.
+ */
export const MISTRAL_REASONING_URL =
- 'https://docs.mistral.ai/studio/conversations/reasoning.md'
+ 'https://docs.mistral.ai/inference/conversations/reasoning'
+
+/**
+ * Mistral's docs site returns a full HTML document where `llms.txt` still
+ * names a `.md` twin. The reasoning and web-search parsers read the
+ * markdown shape, so a rendered page becomes that shape: code becomes
+ * backticks, links become `[text]`, list items become bullets. A markdown
+ * body is returned unchanged.
+ */
+export function mistralDocsMarkdown(body: string): string {
+ if (!/]/i.test(body)) return body
+ let text = body
+ .replace(/