Repository navigation
fix(gateway): fall back from exhausted WARP exits and filter deprecated models - #196
Closed
skargaklop wants to merge 1 commit into
Closed
skargaklop wants to merge 1 commit into
skargaklop wants to merge 1 commit into
Conversation
…ed models - Fall back to configured proxy/direct pool when WARP anonymous exits fail with 429, IP block, or unavailability - Filter deprecated models during capability discovery - Return 410/404 instead of misleading 400 unsupported protocol for retired models - Align v2 client version to 2.4.2
jasonxu114514
added a commit
that referenced
this pull request
Nov 29, 2026
Owner
|
已在 main 以 fc7744a 修正後實作並驗證,本 PR 由該提交取代,將納入 v1.5.2。與原提案不同,warp.proxy_fallback 預設 false,必須明確允許匿名流量改走已配置代理/直連;WARP 與回退共用一次熔斷准入,避免 threshold=1/half-open 提前阻斷。另排除 deprecated 能力並防止同 Tier 文件重新引入,區分未知/不可用/不支援協議。未包含無必要的客戶端版本號變更。感謝提案;關閉此 PR 而不直接合併。 |
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.
I am an AI agent submitting this pull request on behalf of the user.
Summary of Changes
WARP-to-Proxy/Direct Fallback for Anonymous Free Models (
internal/gateway/upstream.go):warp.enabled: trueis configured and anonymous free-model requests go through WARP, rate limits (429), IP abuse blocks (errFreeTierIPBlocked), or tunnel/acquisition unavailability (errWARPUnavailable) previously caused the request to fail immediately even if working proxies or"direct"were configured.doAnonymousProxyUpstreamusing the configuredproxieslist, properly buffering and draining superseded response bodies and chaining attempt offsets.Filter Deprecated Models in Capability Discovery (
internal/models/discovery.go):Statusparsing tocapabilityModelinFetchCapabilities."status": "deprecated"inhttps://models.opencode.ai/api.json(e.g.glm-5.3-flash-free) are no longer imported into native protocols and metadata.Accurate Error Reporting for Retired vs Unsupported Protocol Models (
internal/models/catalog.go,internal/gateway/gateway.go):HasUnsupportedProtocol(model)onModelCatalog.400 invalid_request_error: "the model uses an upstream protocol that opencode2api does not expose"for models that are retired/unavailable upstream; instead returns410 Gone(or404 model_not_found), reserving400for models that actually declare unsupported SDKs.Client Version Alignment (
internal/httpx/client.go):v2ClientVersionfrom"2.1.1"to"2.4.2"to match current OpenCode releases.Verification
go vet ./...andgofmtclean).HTTP 200ondeepseek-v4.1-flash-free(anon:429@warp -> anon:200@direct).glm-5.3-flash-freereturned clear404 model_not_foundinstead of misleading 400 protocol error.