fix: address M2.5 verifier findings before merge

AIMD ceiling now respects per-source max_concurrency and the pacer is
assembled explicitly in the client; MIN_CALLS parses as strict int;
acceptance doc corrects source-5 attempt count to 549; design and
migration notes aligned with implemented 429/stall/suppression
semantics and AIMD constants documented.
This commit is contained in:
2026-07-21 21:10:02 -04:00
parent 9d28e03d49
commit a06761917e
7 changed files with 61 additions and 5 deletions
+6
View File
@@ -25,6 +25,7 @@ from polygateway.middleware.telemetry import TelemetryEmitter, TelemetryMW
from polygateway.pricing import PricingTable
from polygateway.providers import get_provider
from polygateway.sources import (
AdaptivePacer,
HealthAwareSelector,
LeastInflightSelector,
RoundRobinSelector,
@@ -97,6 +98,10 @@ class GatewayClient:
backpressure=backpressure,
quota_full=quota_full,
cooldown_memo=SourceCooldownMemo(now=now),
# AIMD ceiling 尊重源级静态并发上限(独立核验 I1: 不得静默钳制大于 64 的配置)
pacer=AdaptivePacer(
ceiling=float(max([64, *(s.max_concurrency for s in sources if s.max_concurrency)]))
),
emitter=emitter,
now=now,
sleep=sleep,
@@ -128,6 +133,7 @@ class GatewayClient:
)
)
self._structured_available = structured_strategy is not None
self._terminal = terminal # 内部引用: 装配自省/测试用
self._handler = compose(middlewares, terminal)
self._transport = transport
self._telemetry = telemetry