Skip to content

The agent that grows with you

fix(anthropic): distinguish snapshot dates from minor versions

JoaoMarcos4417e4143aeed6
diff --git a/agent/anthropic_thinking_policy.py b/agent/anthropic_thinking_policy.py
index 1e2333998e1..f84190aa50a 100644
--- a/agent/anthropic_thinking_policy.py
+++ b/agent/anthropic_thinking_policy.py
@@ -18,7 +18,9 @@ from agent.anthropic_endpoints import (
_CLAUDE_VERSION_RE = re.compile(
- r"claude[-_.](opus|sonnet|fable|mythos)[-_.](\d+)(?:[-_.](\d+))?",
+ # Semantic minors are short version components. Snapshot dates such as
+ # claude-opus-4-20250514 must remain 4.0 rather than becoming 4.20250514.
+ r"claude[-_.](opus|sonnet|fable|mythos)[-_.](\d+)(?:[-_.](\d{1,2})(?=$|[-_.]))?",
re.IGNORECASE,
)