From 223e4ae0e9c5be6ebc0a15c1aa0a1f8eccd215c1 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 16 Apr 2026 19:47:05 +0200 Subject: [PATCH] copilot_chat: Set Copilot output config only when effort exists (#54103) It seems their verification got stricter, at least stricter than Anthropics. Only set the output config if we have an effort. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #54036 Release Notes: - copilot_chat: Fix invalid reasoning effort for some models. Co-authored-by: John Tur --- crates/language_models/src/provider/copilot_chat.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/language_models/src/provider/copilot_chat.rs b/crates/language_models/src/provider/copilot_chat.rs index a77e3f880be18d8f9f0e97ec8717c32bc780e267..8b46c38f2524a048d60ba4b2892b200a824f69e8 100644 --- a/crates/language_models/src/provider/copilot_chat.rs +++ b/crates/language_models/src/provider/copilot_chat.rs @@ -405,7 +405,10 @@ impl LanguageModel for CopilotChatLanguageModel { if model.supports_adaptive_thinking() { if anthropic_request.thinking.is_some() { anthropic_request.thinking = Some(anthropic::Thinking::Adaptive); - anthropic_request.output_config = Some(anthropic::OutputConfig { effort }); + anthropic_request.output_config = + effort.map(|effort| anthropic::OutputConfig { + effort: Some(effort), + }); } }