Use Anthropic capability metadata and update model compatibility (#67203)

- Read compaction support and accepted thinking modes from the Anthropic
Models API.
- Infer system-message updates, preserved-thinking prefix binding,
adaptive-only thinking, and temperature restrictions from Claude family
and version. Keep fast mode and forced tool choice on explicit model
lists.
- Use an advertised thinking-off mode when available; otherwise retain
model-specific fallbacks for missing metadata and let models without an
off mode use their default.
- Cover family cutoffs, future model IDs, and request serialization in
regression tests.

Validation: 49 Anthropic unit tests, `cargo check -p language_models`,
formatting, and `git diff --check` passed.

Release Notes:

- Improved compatibility with new Claude models and kept Inline Assist
working on models that cannot turn thinking off.
This commit is contained in:
Bennet Bo Fenner
2026-11-20 12:48:18 +00:00
committed by GitHub
parent 87e6a02e1e
commit ad1058d78d
7 changed files with 502 additions and 182 deletions
+1
View File
@@ -55,6 +55,7 @@ pub async fn stream_completion(
1.0,
model.max_output_tokens().unwrap_or(8192),
mode,
None,
AnthropicPromptCacheMode::Automatic,
&config.provider_id,
)?;