mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
The WARP pool could never rotate: its lifetime context was derived from the startup deadline, so every standby registration and replacement died with "context canceled" and requests stayed on the first egress forever. Give the first registration the caller's deadline and the pool a context that only Close cancels. - warp.pool_size is an upper bound. The active ring follows concurrency (one exit per lease, one per queued request, plus a spare) and trims idle surplus after 60 seconds, so a burst expands it and quiet periods shrink it. - An IPv6 exit is deduplicated and cooled by its /64 for 30 minutes (IPv4 by its /32), since the free quota is scoped to that block. - 429/403 retires an exit immediately and re-registers right away; a free model request keeps switching exits and only returns the last 429 after retry.max_attempts, on both the anonymous and the Zen-key lane. 429s no longer trip the anonymous breaker or cool the key. - Pin HTTP/1.1 ALPN and TLSNextProto on the WARP transport: a clone of DefaultTransport made after its first dial negotiated h2 and fed SETTINGS frames to the HTTP/1.x reader, breaking catalog refresh. - Default to the IPv6 stack and, with warp.source_ipv6, let each exit bind its own outer source from a routed prefix via IPV6_FREEBIND. Endpoints try IPv6 first and fall back to IPv4, so IPv4-only hosts keep working. - WebUI, config example and all READMEs describe the new pool and rotation behaviour.
70 lines
1.5 KiB
JSON
70 lines
1.5 KiB
JSON
{
|
|
"listen": "127.0.0.1:8080",
|
|
"server_keys": ["change-this-local-key"],
|
|
"zen_keys": [],
|
|
"go_keys": [],
|
|
"anonymous": true,
|
|
"warp": {
|
|
"enabled": false,
|
|
"pool_size": 2,
|
|
"stack": "ipv6",
|
|
"source_ipv6": ""
|
|
},
|
|
"proxies": ["direct"],
|
|
"proxyfile": "",
|
|
"upstream": {
|
|
"zen": "https://opencode.ai/zen",
|
|
"go": "https://opencode.ai/zen/go",
|
|
"anonymous": "https://opencode.ai/inference"
|
|
},
|
|
"retry": {
|
|
"max_attempts": 3,
|
|
"timeout_seconds": 300
|
|
},
|
|
"models": {
|
|
"refresh_seconds": 300,
|
|
"protocols": {},
|
|
"free_only": false
|
|
},
|
|
"performance": {
|
|
"max_idle_conns": 2048,
|
|
"max_idle_conns_per_host": 256,
|
|
"max_conns_per_host": 0,
|
|
"idle_conn_timeout_seconds": 120,
|
|
"connect_timeout_seconds": 5,
|
|
"failure_cooldown_seconds": 15,
|
|
"attempt_timeout_seconds": 0,
|
|
"first_event_timeout_seconds": 0,
|
|
"max_anonymous_exits": 8,
|
|
"free_tier_block_seconds": 900
|
|
},
|
|
"logging": {
|
|
"level": "info",
|
|
"ring_size": 2000,
|
|
"dump_request_bodies": false
|
|
},
|
|
"webui": {
|
|
"enabled": true,
|
|
"listen": "0.0.0.0:8081",
|
|
"username": "admin",
|
|
"password": "change-this-admin-password",
|
|
"session_ttl_minutes": 720
|
|
},
|
|
"prefer": "go",
|
|
"reasoning": {
|
|
"effort": "high",
|
|
"effort_by_model": {}
|
|
},
|
|
"rotation": {
|
|
"sota": {
|
|
"alias": "sota",
|
|
"order": ["deepseek-v4.1-flash", "glm-5.3", "grok-4.6", "kimi-k3", "qwen3.8-max"]
|
|
},
|
|
"sweet": {
|
|
"alias": "sweet",
|
|
"order": []
|
|
},
|
|
"first_output_seconds": 30
|
|
}
|
|
}
|