Skip to content

Releases: blhsing/copilot-adapter

v1.0.7

Choose a tag to compare

@blhsing blhsing released this 01 Jun 02:54

Fixes

  • Serve with no Copilot account. resolve_github_tokens used 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 on Please visit github.com/login/device … Aborted! in headless/container environments. serve now resolves Copilot tokens non-interactively and tolerates zero Copilot accounts; the pool can be built entirely from Anthropic and/or ChatGPT accounts. The login command keeps its interactive device flow.

v1.0.6

Choose a tag to compare

@blhsing blhsing released this 01 Jun 01:27

Improvements

  • Hardened Copilot upstream compatibility. Tuned the upstream httpx timeouts (connect 30s / read 1200s / write 90s) to stop large-prompt uploads from tripping WriteTimeout mid-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 408 user_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

Choose a tag to compare

@blhsing blhsing released this 29 May 17:26

Fixes

  • Rate-limited account is now sidelined even when no fallback exists. The previous logic in get_fallback_client only 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 get None back 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

Choose a tag to compare

@blhsing blhsing released this 29 May 17:20

New features

  • Claude Max pooling. Real Claude Max subscriptions can now be added alongside Copilot accounts via the new anthropic-login flow. /v1/messages traffic prefers the Anthropic pool when available and falls back to Copilot.
  • ChatGPT (Codex) backend pool. ChatGPT subscriptions can be added via codex-login. /v1/responses traffic prefers the ChatGPT pool and falls back to Copilot.
  • Live-utilization rotation. New default strategy least-utilized polls real backend usage (Anthropic /api/oauth/usage, ChatGPT /wham/usage) every ~3 minutes and routes to whichever account has the lowest live utilization. round-robin is 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 the max-usage / min-usage strategies — Copilot's move to credit-based pricing made the local counter meaningless. Strategies max-usage / min-usage silently fall back to least-utilized.

v1.0.3

Choose a tag to compare

@blhsing blhsing released this 15 May 05:34

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 to 0 to restore the previous fully-async behavior.

v1.0.2

Choose a tag to compare

@blhsing blhsing released this 15 May 04:44

Fixes

  • Strip output_config.format before forwarding to upstream. Copilot routes Claude through Google Vertex AI on its backend, and at least one Vertex project hosting claude-opus-4-7 has an org policy that blocks the structured_outputs feature, so any request asking for output_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 drops output_config.format so the call goes through as plain text — well-formed JSON usually still comes back because the surrounding prompt asks for it.

v1.0.1

Choose a tag to compare

@blhsing blhsing released this 12 May 03:09

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_exhausted and get_fallback_client both 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_usage crossing the monthly limit) still requires a manual reset, since that's a billing limit, not a transient failure.

v1.0.0

Choose a tag to compare

@blhsing blhsing released this 30 Apr 01:33

Strip empty text content blocks before forwarding to Anthropic to avoid spurious 400s.