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

+1 -1
View File
@@ -150,7 +150,7 @@ class TestHubReviews(HubCase):
def test_review_wait_times_out_at_the_cap(self):
review_id = self.request("feat: slow", "")
started = time.monotonic()
with mock.patch.object(reviewing, "WAIT_CAP", 0.2):
with mock.patch.object(reviewing, "MCP_WAIT_CAP", 0.2):
result = self.tool("review_wait", {"id": review_id, "timeout_seconds": 10**6})
self.assertLess(time.monotonic() - started, 5)
self.assertEqual(result["structuredContent"]["status"], "pending")