Part of #1. Depends on #2.
Goal
Add a service-layer client that POSTs to `${copilotBaseUrl(state)}/responses` with the correct VS Code spoof headers, mirroring the existing `create-chat-completions.ts`.
Current state
`src/services/copilot/` has only three call sites:
- `create-chat-completions.ts:31` → `/chat/completions`
- `create-embeddings.ts:8` → `/embeddings`
- `get-models.ts:6` → `/models`
No code anywhere POSTs to a URL containing `responses`.
Tasks
Acceptance criteria
- Calling the service against a real Copilot token returns a 200 for `gpt-5` non-streaming, with `output[]` array shape
- Streaming returns SSE chunks with `response.output_text.delta` events
- Headers passed upstream match VS Code's wire format (verifiable with `--verbose`)
File pointers
- `src/services/copilot/create-chat-completions.ts` (reference)
- `src/lib/api-config.ts:16–19` (`copilotBaseUrl`)
- `src/services/copilot/create-chat-completions.ts:21–29` (X-Initiator heuristic)
Reference impl
litellm: `litellm/llms/github_copilot/responses/transformation.py` (`GithubCopilotResponsesAPIConfig`)
Part of #1. Depends on #2.
Goal
Add a service-layer client that POSTs to `${copilotBaseUrl(state)}/responses` with the correct VS Code spoof headers, mirroring the existing `create-chat-completions.ts`.
Current state
`src/services/copilot/` has only three call sites:
No code anywhere POSTs to a URL containing `responses`.
Tasks
Acceptance criteria
File pointers
Reference impl
litellm: `litellm/llms/github_copilot/responses/transformation.py` (`GithubCopilotResponsesAPIConfig`)