From cb2e16da31bffde00c0220e4ac1794b6ee105b29 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 14:18:05 -0400 Subject: [PATCH] copilot_chat: Set Copilot output config only when effort exists (#54103) (cherry-pick to preview) (#54106) Cherry-pick of #54103 to preview ---- 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 Co-authored-by: Ben Brandt 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), + }); } }