Enforce MCP readiness caller deadlines - #711
Conversation
|
Triage: the caller-local readiness deadline/shared-check ownership design is coherent and the current-main textual merge is clean. The historical failure was outside the two-file diff. As author I cannot self-approve; please obtain non-author exact-head review and refresh current-base checks. |
|
Current-main recheck on exact head |
Audit disposition — residual liveness blocker (2026-08-14)Caller-local deadlines now return correctly, but a permanently stalled shared readiness task remains in Please give the shared attempt an owner deadline or retirement rule. A caller timing out should not cancel healthy shared work, but a check that never settles must eventually be fenced, removed, and replaced. Add a deterministic regression with a permanently held first operation and repeated late callers proving that a later generation can recover. |
Deep-review assessment — 2026-08-14Disposition: block on shared-attempt retirement. Caller-local deadline/cancellation waiters correctly prevent one caller from awaiting Give the shared attempt an owner/hard deadline or a retirement generation. After that boundary, detach/ignore any late result, remove the attempt by UUID, and allow a subsequent caller to create a fresh check. Add a test where the first operation never releases and a later generation succeeds. |
Root cause
MCPToolCatalogReadiness.awaitReady(timeout:)computed a caller deadline, but both creators and joiners awaited the sharedCheckAttempt.task.valuedirectly. IfscopePresenceOperationorwindowStateOperationstalled, control never returned to the deadline checks, so callers could wait forever beyond their requested timeout.Fix
activeChecksonly when the shared task settles, guarded by the attempt UUIDfalsewhile the shared query remains held, query count stays at 1, a late waiter joins the same check, and surviving waiters drain successfully after releaseValidation
make dev-test FILTER='RepoPromptTests.ToolCatalogSnapshotTests/testReadinessCallerDeadlineDoesNotCancelSharedCheck'make dev-test FILTER='RepoPromptTests.ToolCatalogSnapshotTests/testReadinessCoalescesLightweightScopeQueriesForOneTenAndOneHundredWaiters'make dev-format(0/1449 files formatted on final pass)make dev-lintmake dev-swift-build PRODUCT=RepoPrompt.agents/skills/rpce-contribution-check/scripts/preflight.sh commit.agents/skills/rpce-contribution-check/scripts/preflight.sh push