• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 28972441272

08 Jul 2026 08:11PM UTC coverage: 67.894% (-0.06%) from 67.954%
28972441272

push

github

web-flow
Add ListBackends/LookupBackend to the vMCP core interface (#5763)

* Add ListBackends/LookupBackend to the vMCP core interface

Add backend-level enumeration to the pkg/vmcp/core VMCP interface so embedders
get a first-class backend view instead of reverse-engineering it (lossily) from
ListTools. One ListBackends method serves two surfaces via a filterUnauthorized
bool, plus LookupBackend for a single authorized resolve.

  - false (admin): all group-scoped backends from the registry, no aggregation,
    no admission, no health filter. identity may be nil; caller-authz is the API
    layer's concern.
  - true (user-discovery): a backend appears iff the identity is admitted at
    least one of its discovered capabilities. Aggregates over the full registry
    (health is a status, not a visibility filter), runs the existing admission
    seam, and unions the surviving capabilities' BackendIDs. A zero-capability
    backend is vacuously hidden.

LookupBackend resolves in the authorized view and returns vmcp.ErrNotFound for an
unknown, out-of-group, or unauthorized id, mirroring LookupTool.

Extract aggregateOverAll so the health-filtered data path and the full-registry
backend derivation share one aggregation error-wrap. The codemode/ratelimit
decorators embed core.VMCP and auto-promote the new methods; the two hand-rolled
server test doubles (stubVMCP, fakeCore) gain no-op implementations.

Closes #5741

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Address review: empty-group short-circuit, tests, doc/naming

Follow-up to review on #5763:

  - ListBackends(authorized) now returns an empty (non-nil) slice for an empty
    group instead of diving into aggregation and surfacing the aggregator's
    "no backends returned capabilities" sentinel as an error. A non-empty group
    that is entirely unreachable still errors (consistent with ListTools) — that
    is a live failure, not an empty answer. Fixes the empty-group divergence
 ... (continued)

48 of 56 new or added lines in 1 file covered. (85.71%)

78 existing lines in 6 files now uncovered.

73041 of 107581 relevant lines covered (67.89%)

63.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.56
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc