fix(mcp): bound relay discovery reads

Merged
KH
3d ago
+80-14

Closes three self-hosted MCP parity gaps in bounded relay discovery.

Changes:

  • Bound list_relay_agents full-roster reads to 10 seconds, including non-cooperative clients.
  • Bound managed native capability verification to 2 seconds and retain safe retry guidance.
  • Bound relay_status exact-name address enrichment to 1 second, log only the operation and error class, and return null address on failure.
  • Document the client-visible reliability changes.

Verification:

  • npm run typecheck (pass)
  • npm run build (pass)
  • node --import tsx --test --test-concurrency=2 test/team-activity-deadline.test.ts test/mcp.test.ts (65/65 pass)
  • npm test (2,073 total; 1,964 pass; 109 skipped; 0 fail)

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Brings self-hosted MCP relay discovery reads in line with Cloud by bounding reads so stalled or non-cooperative clients no longer hang MCP calls indefinitely.

  • list_relay_agents stops waiting for its full-roster read after 10 seconds, even when the client ignores cancellation.
  • describe_capabilities bounds managed native-identity verification at 2 seconds and keeps the safe retry guidance on timeout.
  • relay_status bounds its optional exact-name address enrichment at 1 second, logs only the operation and error class, and returns the record with a null address when the lookup fails, stalls, or no longer matches (for example after a rename).
  • Documents the client-visible reliability changes in the changelog.