fix: don't downgrade xhigh reasoning effort when provider supports it

The current code unconditionally downgrades 'xhigh' to 'high' whenever
'high' is in supported_efforts, even if 'xhigh' is also supported.
This prevents users from using extended thinking on providers like
Copilot that list 'xhigh' in their supported efforts.

Fix: only downgrade 'xhigh' to 'high' when 'xhigh' is NOT in the
provider's supported efforts list.
This commit is contained in:
Al Sayed Hoota 2026-04-15 19:11:44 +04:00 committed by Teknium
parent 0678f8f019
commit 633fc7ab88

View file

@ -5568,7 +5568,7 @@ class AIAgent:
else:
requested_effort = "medium"
if requested_effort == "xhigh" and "high" in supported_efforts:
if requested_effort == "xhigh" and "xhigh" not in supported_efforts and "high" in supported_efforts:
requested_effort = "high"
elif requested_effort not in supported_efforts:
if requested_effort == "minimal" and "low" in supported_efforts: