fix(opencode): resolve GitHub Copilot base URL from token#25995
fix(opencode): resolve GitHub Copilot base URL from token#25995massimopalmieri wants to merge 2 commits into
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found related PRs that address similar Copilot token handling issues:
These PRs appear to be addressing similar concerns with Copilot token exchange and OAuth flows, though PR #25995 (your current PR) may be a more recent or focused fix. You may want to review whether these older PRs have been merged or superseded, and ensure your implementation doesn't conflict with or duplicate work from PR #20758 and #18782. |
4dfbceb to
d9f348c
Compare
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
proxy-epfieldProblem
OpenCode used a static GitHub Copilot base URL. In environments where the Copilot token points at a different endpoint, requests should instead follow the endpoint encoded in the token. Pi already handles Copilot this way.
Change
This updates the GitHub Copilot plugin to derive the effective base URL from the Copilot token, using the tokens
proxy-epfield when present and a sensible fallback otherwise.Testing
bun run typecheckbun test test/plugin/github-copilot-models.test.tsCloses #20759