Skip to content

feat: improve proxy compatibility and fallback handling#154

Merged
mxyhi merged 3 commits intomainfrom
feat/proxy-compat-maintenance
Mar 7, 2026
Merged

feat: improve proxy compatibility and fallback handling#154
mxyhi merged 3 commits intomainfrom
feat/proxy-compat-maintenance

Conversation

@mxyhi
Copy link
Owner

@mxyhi mxyhi commented Mar 7, 2026

Summary

  • add same-provider upstream cooldown selection to avoid repeatedly hitting recently failed upstreams
  • improve models routing compatibility for OpenAI, Gemini, and Anthropic request patterns
  • close the Anthropic proxy loop by fixing auth fallback and stripping Anthropic-only query/header metadata on non-Anthropic fallbacks
  • update OpenCode model labels and README quick-start notes

Details

  • P0: add upstream_selector runtime and cooldown-aware ordering within the same provider/priority group
  • P1: support explicit /v1/models*, /v1beta/models*, and /v1beta/openai/models* routing, plus header/query-aware provider hints
  • P2: harden Anthropic compatibility for:
    • lowercase bearer local auth
    • Authorization -> upstream x-api-key fallback
    • stripping beta=true, anthropic-version, anthropic-beta, and x-stainless-* when Anthropic requests fall back to non-Anthropic providers
  • docs/UI: keep .reference and planning files ignored, add OpenCode config guidance, and use readable OpenCode model display names

Validation

  • cargo test -p token_proxy_core
  • cargo test -p token_proxy --lib

@mxyhi mxyhi merged commit 4667f4d into main Mar 7, 2026
1 check passed
@mxyhi mxyhi deleted the feat/proxy-compat-maintenance branch March 7, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant