mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 16:04:01 +00:00
fix(warp): add opt-in anonymous proxy fallback and retirement handling (#196)
This commit is contained in:
1 parent
fac8dd3d7c
commit
fc7744a509
15 files changed
+126
-29
No files matched your search
@@ -193,6 +193,8 @@ For bulk cleanup, only `unavailable` is a confirmed-unavailable filter for that
|
||||
|
||||
WARP is disabled by default. When enabled, free anonymous/manual-Zen requests and their discovery/probe paths use an in-process tunnel. Go, paid, and OAuth routes retain proxy routing. It needs outbound Cloudflare UDP on port `2408`, without TUN or routing-table changes. `warp.pool_size` is a concurrency-driven exit ceiling of 1–32 (default 2). `warp.stack` defaults to `ipv6`, with `ipv4`/`dual` also available. Initialization failure rejects startup or the candidate configuration without silently falling back to proxies.
|
||||
|
||||
The configuration page can explicitly enable `warp.proxy_fallback` (default `false`) for anonymous inference only. Eligible failures are WARP 429, an IP-abuse block, or explicit egress unavailability, while the original client/request budget remains active. Configured direct routes may reveal the host's public IP. Key-only injected direct routes, OAuth/manual-key policy, catalog/probe paths, and pinned diagnostics are unaffected. This does not bypass WARP initialization failure or guarantee fallback when waiting for an exit exhausts the request budget.
|
||||
|
||||
Exit statuses 403/429 can trigger retirement and replacement, with retries still bounded by their budget. A new exit does not guarantee additional quota. IPv6 `/64` and IPv4 `/32` egress blocks are deduplicated/cooled. `warp.source_ipv6` requires the IPv6 stack and a prefix of `/64` or shorter. Linux uses `IPV6_FREEBIND`; Windows requires the selected source addresses to be assigned already. This setting does not configure host networking. `/healthz` reports WARP state/counts only; `resources.warp` in `/api/monitor` also contains exit information.
|
||||
|
||||
## SOTA / Sweet rotation
|
||||
|
||||
@@ -192,6 +192,8 @@ Key、代理、上游、超时、模型、偏好、reasoning 和日志设置热
|
||||
|
||||
WARP 默认关闭。开启后免费匿名/手动 Zen 请求及对应目录/探测使用进程内隧道;Go、付费与 OAuth 保持代理路由。需要 Cloudflare UDP `2408`,不需要 TUN 或改路由表。`warp.pool_size` 为 1–32 的并发出口上限(默认 2),`warp.stack` 默认为 `ipv6`,也可 `ipv4`/`dual`。初始化失败拒绝启动或候选配置,不静默改走代理。
|
||||
|
||||
配置页面可显式开启 `warp.proxy_fallback`(默认 `false`),仅在客户端/请求预算仍有效,且匿名推理遇到 WARP 429、IP 滥用封锁或明确出口不可用时回退。已配置直连可能暴露主机公网 IP。内部密钥专用直连、OAuth/手动 Key 策略、目录/探测与固定出口诊断不受影响;不绕过 WARP 初始化失败,也不保证等待出口耗尽预算后仍有回退机会。
|
||||
|
||||
出口 403/429 可触发退役与补充,重试仍受预算限制;更换出口不保证额外额度。IPv6 `/64`、IPv4 `/32` 出口按网段去重/冷却。`warp.source_ipv6` 要求 IPv6 堆栈、`/64` 或更短前缀;Linux 使用 `IPV6_FREEBIND`,Windows 必须已分配所选源地址。该设置不会配置主机网络。`/healthz` 只提供 WARP 状态/数量,`/api/monitor` 的 `resources.warp` 另含出口信息。
|
||||
|
||||
## SOTA / Sweet 轮转
|
||||
|
||||
Reference in new issue
Block a user