From 3bc28ac691aafa8ef2b8e232a63c318e432c090b Mon Sep 17 00:00:00 2001 From: majdyz Date: Tue, 21 Apr 2026 23:43:25 +0700 Subject: [PATCH] refactor(backend/copilot): tighten anthropic prefix match + trim fast_advanced_model comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - _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. --- .../backend/copilot/baseline/reasoning.py | 2 +- .../backend/backend/copilot/config.py | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/autogpt_platform/backend/backend/copilot/baseline/reasoning.py b/autogpt_platform/backend/backend/copilot/baseline/reasoning.py index f5f8b576bb..0c689ed4a7 100644 --- a/autogpt_platform/backend/backend/copilot/baseline/reasoning.py +++ b/autogpt_platform/backend/backend/copilot/baseline/reasoning.py @@ -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 diff --git a/autogpt_platform/backend/backend/copilot/config.py b/autogpt_platform/backend/backend/copilot/config.py index 0c3c55d8dc..1183217f37 100644 --- a/autogpt_platform/backend/backend/copilot/config.py +++ b/autogpt_platform/backend/backend/copilot/config.py @@ -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",