Releases: blhsing/copilot-adapter
Releases · blhsing/copilot-adapter
Release list
v1.0.7
Fixes
- Serve with no Copilot account.
resolve_github_tokensused to fall through to interactive device-flow OAuth whenever no Copilot token resolved, then raise if that yielded nothing — so running the proxy on Anthropic/ChatGPT backends alone (empty Copilot cache) crash-looped onPlease visit github.com/login/device … Aborted!in headless/container environments.servenow resolves Copilot tokens non-interactively and tolerates zero Copilot accounts; the pool can be built entirely from Anthropic and/or ChatGPT accounts. Thelogincommand keeps its interactive device flow.
v1.0.6
Improvements
- Hardened Copilot upstream compatibility. Tuned the upstream httpx timeouts (connect 30s / read 1200s / write 90s) to stop large-prompt uploads from tripping
WriteTimeoutmid-flight, and added automatic retries (up to 2, with 0.3s/0.6s backoff and a fresh connection each attempt) for transient transport failures — HTTP 408user_request_timeout,httpx.WriteTimeout,httpx.ConnectTimeout, and connection resets — on both non-streaming and streaming requests. - Account-manager tests updated for the live-utilization rotation model.
v1.0.5
Fixes
- Rate-limited account is now sidelined even when no fallback exists. The previous logic in
get_fallback_clientonly sidelined the failed account after confirming a fallback was available. In the new multi-backend pool, this caused real cascade failures: once one Copilot account got sidelined for 60 minutes, a 429 on the surviving account triggered no sideline at all, just an unmarked "switching account" log followed by another request that re-hit the same 429 a few seconds later. Sideline is now unconditional — callers that getNoneback should surface the upstream error, and single-account installs get an "all accounts unavailable" surface during the backoff window instead of looping on a known-bad account.
v1.0.4
New features
- Claude Max pooling. Real Claude Max subscriptions can now be added alongside Copilot accounts via the new
anthropic-loginflow./v1/messagestraffic prefers the Anthropic pool when available and falls back to Copilot. - ChatGPT (Codex) backend pool. ChatGPT subscriptions can be added via
codex-login./v1/responsestraffic prefers the ChatGPT pool and falls back to Copilot. - Live-utilization rotation. New default strategy
least-utilizedpolls real backend usage (Anthropic/api/oauth/usage, ChatGPT/wham/usage) every ~3 minutes and routes to whichever account has the lowest live utilization.round-robinis still available. --copilot-only-client. Pin specific client IPs / CIDRs / hostname globs to the Copilot pool only (skipping Anthropic / ChatGPT pools), useful when a particular user shouldn't drain shared subscriptions.
Removed
premium_used/quota_limit/ per-model multipliers and themax-usage/min-usagestrategies — Copilot's move to credit-based pricing made the local counter meaningless. Strategiesmax-usage/min-usagesilently fall back toleast-utilized.
v1.0.3
Improvements
- First-request hostnames in access logs. Reverse-DNS lookups used to run fully async, so the very first log line for a new client showed only the IP. The proxy now blocks the access-log emission briefly (default 150 ms, tunable via
--reverse-dns-sync-wait-ms/COPILOT_ADAPTER_REVERSE_DNS_SYNC_WAIT_MS) waiting for the lookup, so internal PTR queries that take <200 ms typically resolve in time for the first line. Set the value to0to restore the previous fully-async behavior.
v1.0.2
Fixes
- Strip
output_config.formatbefore forwarding to upstream. Copilot routes Claude through Google Vertex AI on its backend, and at least one Vertex project hostingclaude-opus-4-7has an org policy that blocks thestructured_outputsfeature, so any request asking foroutput_config.format = {"type": "json_schema", ...}came back as HTTP 400 / FAILED_PRECONDITION. Most affected: Claude Code's background session-title generator (~57 errors/day in observed deployments). The proxy now dropsoutput_config.formatso the call goes through as plain text — well-formed JSON usually still comes back because the surrounding prompt asks for it.
v1.0.1
Fixes
-
Rate-limited accounts now auto-recover. Previously, a single transient 429 from upstream Copilot would permanently sideline an account until container restart, because
mark_exhaustedandget_fallback_clientboth flipped a sticky flag. With round-robin and two accounts, a one-time rate limit could pin all traffic to the surviving account for an entire day.Sidelining is now timed: rate-limited accounts become eligible again after a configurable back-off (default 60 minutes) via
--rate-limit-backoff-minutes/COPILOT_ADAPTER_RATE_LIMIT_BACKOFF_MINUTES. Genuine quota-cap exhaustion (record_usagecrossing the monthly limit) still requires a manual reset, since that's a billing limit, not a transient failure.