mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 16:04:01 +00:00
fix(upstream): stop retrying request-level rejections and cap anonymous exits
The anonymous walk now ends on a deterministic 4xx instead of replaying the same context-length rejection through every exit and tier. Static exits are capped by performance.max_anonymous_exits, and an IP-level abuse block marks only its exit; the lane breaker opens only when every exit is blocked, so a single 403 no longer pauses the lane. The Zen key tier is skipped after an IP block while the authenticated Go tier remains available. Add performance.free_tier_block_seconds, make the breaker half-open probe single-flight, and coordinate refreshes and availability probes with the breaker. Update the shipped example to start on the anonymous lane.
This commit is contained in:
1 parent
ddb5c14b3f
commit
0bb23c7a7f
11 files changed
+265
-85
No files matched your search
+5
-3
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"listen": "127.0.0.1:8080",
|
||||
"server_keys": ["change-this-local-key"],
|
||||
"zen_keys": ["sk-your-zen-key"],
|
||||
"zen_keys": [],
|
||||
"go_keys": [],
|
||||
"anonymous": false,
|
||||
"anonymous": true,
|
||||
"proxies": ["direct"],
|
||||
"proxyfile": "",
|
||||
"upstream": {
|
||||
@@ -28,7 +28,9 @@
|
||||
"connect_timeout_seconds": 5,
|
||||
"failure_cooldown_seconds": 15,
|
||||
"attempt_timeout_seconds": 0,
|
||||
"first_event_timeout_seconds": 0
|
||||
"first_event_timeout_seconds": 0,
|
||||
"max_anonymous_exits": 8,
|
||||
"free_tier_block_seconds": 900
|
||||
},
|
||||
"logging": {
|
||||
"level": "info",
|
||||
|
||||
Reference in new issue
Block a user