The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
perf(agent,gateway): back cancel-wait polls off from 1ms to 25ms (re-review #5)
Teknium06bdc48c1ff4
diff --git a/agent/conversation_compression.py b/agent/conversation_compression.pyindex 206fc663449..35430b1c792 100644--- a/agent/conversation_compression.py+++ b/agent/conversation_compression.py@@ -972,7 +972,12 @@ def run_compress_context_with_progress_timeout(breakcancelled = fence.try_cancel_before_commit()if cancelled is None:- time.sleep(0.001)+ # Round-2 #5: the fence is only held transiently here (lock+ # setup / cancel admission — an in-flight commit is caught by+ # the commit_in_flight check above), but that window rides+ # SessionDB write patience and can last seconds. 25ms keeps+ # sub-tick latency without a 1kHz spin.+ time.sleep(0.025)if not cancelled:# Pre-commit ceiling already elapsed, but begin_commit() won the# race. Waiting is intentional: SessionDB mutation cannot bediff --git a/gateway/run.py b/gateway/run.pyindex e75d11b9404..345a69e100c 100644--- a/gateway/run.py+++ b/gateway/run.py@@ -16747,7 +16747,12 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew_hyg_commit_fence.try_cancel_before_commit())if _cancelled is None:- await asyncio.sleep(0.001)+ # Round-2 #5: transient+ # lock-setup windows ride+ # write patience for seconds;+ # 25ms keeps sub-tick latency+ # without 1kHz spin.+ await asyncio.sleep(0.025)if not _cancelled:# The worker crossed the commit boundary just# before the timeout. The fence poll waited for