fix(очередь): нулевой или отрицательный шаг keepalive не крутит цикл без пауз

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
anor
2026-10-28 10:38:31 +10:00
co-authored by Claude Opus 5.5
parent f240de659d
commit c81969199f
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -115,3 +115,12 @@ def test_limit_comes_from_setting(monkeypatch):
monkeypatch.setenv("AGENT_MAX_CONCURRENT", "abc")
importlib.reload(claude_bridge)
assert claude_bridge.MAX_CONCURRENT == 3 # мусор в настройке — прежний предел
def test_zero_keepalive_setting_falls_back(monkeypatch):
# Ноль или минус дали бы бешеный цикл keepalive без пауз (нашёл дипсик 28.10.2026).
import claude_bridge
for bad in ("0", "-5", "abc"):
monkeypatch.setenv("AGENT_QUEUE_KEEPALIVE", bad)
importlib.reload(claude_bridge)
assert claude_bridge.QUEUE_KEEPALIVE == 20.0