Skip to content

copilot: Wire up reasoning tokens for GPT models#53313

Merged
bennetbo merged 6 commits intozed-industries:mainfrom
TwistingTwists:2026-03-reasoning-tokens
Apr 20, 2026
Merged

copilot: Wire up reasoning tokens for GPT models#53313
bennetbo merged 6 commits intozed-industries:mainfrom
TwistingTwists:2026-03-reasoning-tokens

Conversation

@TwistingTwists
Copy link
Copy Markdown
Contributor

@TwistingTwists TwistingTwists commented Apr 7, 2026

Fix two issues with reasoning support in the Copilot provider:

  • Responses API path: use the user's thinking_effort setting instead of hardcoding Medium effort
  • Chat Completions path: compute and pass thinking_budget when thinking is enabled, instead of unconditionally setting it to None

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #52140

Release Notes:

  • Fixed a bug where copilot wouldn't use the thinking level the user's have set

Fix two issues with reasoning support in the Copilot provider:

- Responses API path: use the user's thinking_effort setting instead of
  hardcoding Medium effort
- Chat Completions path: compute and pass thinking_budget when thinking
  is enabled, instead of unconditionally setting it to None
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 7, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested a review from a team April 7, 2026 15:02
@zed-community-bot zed-community-bot bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Apr 7, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from danilo-leal and maxbrunsfeld and removed request for a team April 7, 2026 15:02
@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Apr 7, 2026
@TwistingTwists TwistingTwists marked this pull request as draft April 7, 2026 15:03
@danilo-leal danilo-leal removed their assignment Apr 7, 2026
@TwistingTwists TwistingTwists marked this pull request as ready for review April 8, 2026 02:06
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested a review from a team April 8, 2026 02:06
@danilo-leal danilo-leal removed their assignment Apr 8, 2026
@Kryan90
Copy link
Copy Markdown

Kryan90 commented Apr 17, 2026

Any chance of this getting merged soon? Having to use VSCode for high thinking for GPT models is big sad.

@SomeoneToIgnore SomeoneToIgnore added the area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features label Apr 19, 2026
@bennetbo bennetbo self-assigned this Apr 20, 2026
@bennetbo
Copy link
Copy Markdown
Member

Hey, this was not actually working for me. I pushed a commit matching VSCode's behaviour and it seems to work. Will test it a bit more and merge soon.

&& self
.supported_endpoints
.contains(&ModelSupportedEndpoint::Responses)
self.supported_endpoints
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this so that we prefer the responses API when it's available, since the old API does not seem to support reasoning_effort

@bennetbo bennetbo merged commit 1115f76 into zed-industries:main Apr 20, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPT-models like GPT 5.4 from Github Copilot do not use reasoning

7 participants