Repository navigation
feat(plugins): add GitHub Copilot (copilot-auth) built-in provider plugin - #510
Open
CharlesYWL wants to merge 2 commits into
Open
CharlesYWL wants to merge 2 commits into
CharlesYWL wants to merge 2 commits into
Conversation
GitHub device-code login, Copilot token exchange/renewal, model sync with /responses vs /chat/completions routing, x-initiator billing, retry and premium-quota cooling. Bundled via builtin.rs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61a7963c-8ee3-43e0-b08b-6301562403b0
GitHub Copilot rejects oversized prompts with model_max_prompt_tokens_exceeded; treat it as a context overflow so the run compacts and retries like other providers. Drop the unused contextWindow from copilot-auth model data, matching other auth plugins that leave context tiers to the host. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61a7963c-8ee3-43e0-b08b-6301562403b0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明 / What
新增内置 Provider 插件 copilot-auth:用自己的 GitHub Copilot 订阅在 cursor-byok 中使用 Copilot 模型(GPT / Claude / Gemini 等)。设计文档见 copilot-auth-plugin.md。
行为要点:
/models,只保留已启用的 chat 模型;声明/responses的非 Anthropic 模型走 Responses API,其余走 Chat Completions,仅支持/v1/messages的模型暂不提供。x-initiator:最后一条是用户输入时为user,工具结果 / 助手续跑回合为agent,不额外消耗 premium request。model_max_prompt_tokens_exceeded时宿主现在会识别为上下文超长并压缩重试。constants.ts。关联 Issue / Related Issue
无直接关联 Issue。
测试方式 / How to Test
自动化:
cd server/plugins/build-in/copilot-auth && deno test --allow-read(24 passed),deno check main.ts、deno fmt --check、deno lint通过cargo test -p cursor-server --lib plugin::(19 passed)、run::compaction(13 passed),cargo fmt --all -- --check通过手动(已在 Windows 本地
tauri build打包安装验证前两步):仍需更多账号实测:Business / Enterprise 账号的 API 域名是否都在白名单内;子代理 / 摘要请求的
x-initiator计费是否符合预期。