refactor(backend/copilot): tighten anthropic prefix match + trim fast_advanced_model comment

- _is_reasoning_route: match both ``anthropic/`` and ``anthropic.`` explicitly
  so ``anthropic-mock`` and other off-prefix names no longer slip through.
- config.fast_advanced_model: trim verbose K2-Thinking comparison rationale
  from the field description — the PR description is the right place for that.
This commit is contained in:
majdyz
2026-04-21 23:43:25 +07:00
parent 1316e16f04
commit 3bc28ac691
2 changed files with 4 additions and 16 deletions

View File

@@ -183,7 +183,7 @@ def _is_reasoning_route(model: str) -> bool:
existing deployments.
"""
lowered = model.lower()
if lowered.startswith("anthropic"):
if lowered.startswith(("anthropic/", "anthropic.")):
return True
if lowered.startswith("moonshotai/"):
return True

View File

@@ -60,21 +60,9 @@ class ChatConfig(BaseSettings):
)
fast_advanced_model: str = Field(
default="anthropic/claude-opus-4.7",
validation_alias=AliasChoices(
"CHAT_FAST_ADVANCED_MODEL",
),
description="Baseline path, 'advanced' tier. Opus by default so "
"the advanced tier is a clean A/B vs the SDK advanced tier: same "
"model, different path — isolates the reasoning-wire + cache "
"differences from model capability differences. Kimi K2-Thinking "
"(the reasoning-native sibling) benchmarks ~9pp behind K2.6 on "
"SWE-Bench Verified and ~23pp behind on BrowseComp, is text-only, "
"and was published 6 months before K2.6 — not a fit for the "
"advanced tier today. Override via ``CHAT_FAST_ADVANCED_MODEL``. "
"Unlike the other three cells there is no legacy env var to "
"alias — this cell was created in the 2×2 split — but the "
"``validation_alias`` stays explicit so the override isn't "
"coupled to ``env_prefix`` continuing to exist.",
validation_alias=AliasChoices("CHAT_FAST_ADVANCED_MODEL"),
description="Baseline path, 'advanced' tier. Opus by default. "
"Override via ``CHAT_FAST_ADVANCED_MODEL``.",
)
thinking_standard_model: str = Field(
default="anthropic/claude-sonnet-4-6",