feat(github-copilot-sdk): expand Claude Sonnet filters

- Added explicit filtering for Claude 4.0 and 4.5 Sonnet iterations.
This commit is contained in:
fujie
2026-03-20 03:31:58 +08:00
parent 894584330c
commit a5b968676d

View File

@@ -7430,12 +7430,17 @@ class Pipe:
): ):
continue continue
# Filter out older iterations of Claude 3.5 Sonnet if 3.7 (newest) is available # Filter out older iterations of Claude Sonnet (3.5, 4.0, 4.5) as 3.7/4.6 is now available.
# Logic: If user says "already have 4.6", they likely mean the latest 3.7 series. # We target both specific IDs and user-visible names.
# We filter out specific known ID patterns for the older iterations. claude_targets = [
if "claude-3-5-sonnet" in mid or "claude-3.5-sonnet" in mid: "claude-3-5-sonnet",
# Keep only if it's the absolute latest or if 3.7 doesn't exist (safety) "claude-3.5-sonnet",
# But based on user request, we explicitly drop the older ones. "claude-4-0-sonnet",
"claude-4.0-sonnet",
"claude-4-5-sonnet",
"claude-4.5-sonnet",
]
if any(t in mid or t in mname for t in claude_targets):
continue continue
# 2. User-defined Keyword Filter # 2. User-defined Keyword Filter