mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-25 17:22:27 +08:00
Add a GitHub Copilot preset for Codex that uses a managed GitHub account. The local route resolves each request's model against the account's live Copilot /models catalogue and picks the upstream protocol the model advertises (native Responses first, Chat Completions as fallback in auto mode), with an optional explicit protocol override. - Response handling, the opaque-state rectifier and Stack web_search stripping follow the transport actually used for each request rather than the stored apiFormat. - Fetching models fills the catalogue from the account's live prompt limit, parallel tool calls and reasoning levels; presets keep conservative fallbacks. - Codex only treats a card as managed Copilot by its provider type, so self-hosted relays keep their own key and endpoint. - Copilot request identity headers are shared between the Claude and Codex paths. Co-authored-by: yuwk <52391318+ump45nose@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jason <farion1231@gmail.com>