# Add support for GitHub Copilot /responses endpoint \(\#40762\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/92c31278ee16bef7beae5e8ad767fb058bd90986)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 92c31278ee16bef7beae5e8ad767fb058bd90986

Requested commit: 92c31278ee16bef7beae5e8ad767fb058bd90986

Commit: 92c31278ee16bef7beae5e8ad767fb058bd90986

Tree: 600d57149648b86b6f0ce6b0d35fe5db2ad8e30f

Author: Somtoo Chukwurah

Committer: GitHub

## Message

```
Add support for GitHub Copilot /responses endpoint (#40762)

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 - https://github.com/zed-industries/zed/pull/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
<img width="716" height="670" alt="Screenshot from 2025-10-15 17-12-30"
src="https://github.com/user-attachments/assets/14e88a52-ba8b-4209-8f78-73d15034b1e0"
/>

# Image
<img width="923" height="494" alt="Screenshot from 2025-10-21 02-02-26"
src="https://github.com/user-attachments/assets/b96ce97c-331e-45cb-b5b1-7aa10ed387b4"
/>
```

## Parents

- [a7c5b8d78b636afb639cccef80561cec7b5c68cd](https://git.cafe/gitcafe/zed/commit/a7c5b8d78b636afb639cccef80561cec7b5c68cd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/92c31278ee16bef7beae5e8ad767fb058bd90986?format=markdown)
