Skip to content

Conversation

@somtooo
Copy link
Contributor

@somtooo somtooo commented Oct 21, 2025

Add support for GithubCopilot /responses endpoint. This gives the copilot chat provider the ability to use the new GPT-5 codex model and any other model that lacks support for /chat/copmletions endpoint.

Closes #38858

Release Notes:

  • Add support for GithubCopilot /responses endpoint.

Added

  1. copilot_response.rs that has the /response endpoint types
  2. uses response endpoint if model does not support /chat/completions.
  3. new into_copilot_response() to map LanguageCompletionEvents to Request.
  4. new map_stream() to map response stream event to LanguageCompletionEvents and tests.
  5. Fixed a bug where trying to parse response for non streaming for /chat/completion was failing

Notes

There is a pr open - #39989 for adding /response support for OpenAi and OpenAi compatible API. Altough they share some similarities (copilot api seems to mirror openAi directly) ive simplified some stuff and tried to keep it the same with the vscode-chat implementation where possible. There might be a case for code reuse but i think keeping them separate for now should be ok.

Tool Calls

Screenshot from 2025-10-15 17-12-30

Image

Screenshot from 2025-10-21 02-02-26

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 21, 2025
@somtooo somtooo force-pushed the feature/codex-final branch from 6601627 to 1f064e1 Compare October 21, 2025 05:11
copilot chat provider the ability to use the new GPT-5 codex model and
any other model that lacks support for /chat/copmletions endpoint.
@somtooo somtooo force-pushed the feature/codex-final branch from 1f064e1 to 3bb2426 Compare October 21, 2025 05:23
@somtooo somtooo changed the title Add support for GithubCopilot /responses endpoint. Add support for GithubCopilot /responses endpoint Oct 21, 2025
@somtooo
Copy link
Contributor Author

somtooo commented Oct 21, 2025

@ConradIrwin tagging for feedback

@SomeoneToIgnore SomeoneToIgnore added the ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features label Oct 21, 2025
@maxdeviant maxdeviant changed the title Add support for GithubCopilot /responses endpoint Add support for GitHub Copilot /responses endpoint Oct 21, 2025
@ConradIrwin
Copy link
Member

Amazing, thank you!

I tested this a bit and streaming/tool calls etc. seem to work. I like that you kept it isolated, so going to merge.

@ConradIrwin ConradIrwin merged commit 92c3127 into zed-industries:main Oct 24, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI: 400 Bad Request on GPT-5-Codex in Copilot Agent

3 participants