fix(orchestrator): cap MCP tool waits at 50 s below the client timeout

Claude Code's MCP client abandons a tool call before 240 s with "The
operation timed out.", so review_wait, decision_wait and
rule_request_wait now wait at most MCP_WAIT_CAP (50 s) and tell the
caller to call again while the status is pending. HTTP waits keep
WAIT_CAP (300 s). kvb-git-diff step 3 asks for timeout_seconds 50.

🎯 Fix: 95 %
💥 Break: 2 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 93
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-28 00:48:25 +00:00
1 parent b15dd5e414
commit 909ea85605
7 files changed
+17 -13

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ import time
from .denying import request_status, request_words, requester_of
from .errors import Conflict, Missing, ToolError
from .fields import WAIT_CAP, bounded, decode, expect, field, seconds
from .fields import MCP_WAIT_CAP, bounded, decode, expect, field, seconds
from .records import iso_epoch
from .rules import EVERY_AGENT, rule_fields, rule_matches, signed_fields, subject_of
from .signed import signing
@@ -97,7 +97,7 @@ class Requesting:
def rule_request_wait(self, arguments: dict) -> dict:
expect(arguments, ("id", "timeout_seconds"))
request_id = field(arguments, "id")
record = self.rule_requests.wait(request_id, seconds(arguments, "timeout_seconds", WAIT_CAP))
record = self.rule_requests.wait(request_id, seconds(arguments, "timeout_seconds", MCP_WAIT_CAP))
if record is None:
raise ToolError(f"no rule request {request_id}")
return request_state(record, time.time())