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

stacklok / toolhive / 19304282141
51%

Build:
DEFAULT BRANCH: main
Ran 12 Nov 2025 04:27PM UTC
Jobs 1
Files 380
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Nov 2025 04:21PM UTC coverage: 48.907% (+0.3%) from 48.61%
19304282141

push

github

web-flow
Implement lazy per-session capability discovery (#2539)

* Create vMCP-specific VMCPSession type to track routing tables for sessions

Create VMCPSession type that extends StreamableSession with per-session
routing table storage. This enables capability caching per-session.

The VMCPSession type embeds StreamableSession to keep compatibility and
inherit the same session behaviour, but adds a routingTable field
protected by a mutex.

The new type adds GetRoutingTable/SetRoutingTable to access and set the
routing table in a thread-safe way.

When capabilities will be later discovered when the SDK registers a new
session, the routing table will be stored in the vMCPSession and later
retrieved by the vMCP middleware.

* Add context helpers and capability discovery manager

Adds helpers to retrieve capabilities from context and add them to ctx
as well as a discovery manager. The discovery manager is now a simple
passthrough to the aggregator, but will be extended in the future to add
a caching layer.

* Add discovery middleware

Adds a new middleware for capability discovery. The middleware has two branches:

1. Initialize request (no session ID):
    1. Auth middleware extracts user identity
    2. Discovery middleware performs capability aggregation with user context
    3. Discovered capabilities injected into request context
    4. Later: SDK's OnRegisterSession hook stores routing table in VMCPSession to be readable by subsequent requests not sharing ctx

2. Subsequent requests (has session ID):
    1. Discovery middleware retrieves session from session manager
    2. Extracts routing table from VMCPSession
    3. Reconstructs AggregatedCapabilities from cached routing table
    4. Injects into request context for router/handlers to use

This eliminates expensive discovery operations on every request while
maintaining per-user capability isolation. Each session gets its own
routing table based on the user's discovered capabilities at
initialization ti... (continued)

447 of 584 new or added lines in 11 files covered. (76.54%)

10 existing lines in 4 files now uncovered.

24153 of 49386 relevant lines covered (48.91%)

35.67 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
90.24
-9.76% pkg/vmcp/router/default_router.go
5
0.0
0.0% cmd/vmcp/app/commands.go
5
93.67
pkg/vmcp/server/adapter/capability_adapter.go
18
60.87
pkg/vmcp/session/vmcp_session.go
19
80.0
pkg/vmcp/discovery/middleware.go
19
0.0
pkg/vmcp/discovery/mocks/mock_manager.go
31
81.23
18.22% pkg/vmcp/server/server.go
38
0.0
pkg/vmcp/server/adapter/mocks/mock_handler_factory.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
0.0
0.0% cmd/vmcp/app/commands.go
2
90.24
-9.76% pkg/vmcp/router/default_router.go
3
96.5
-2.1% cmd/thv-operator/pkg/sources/git.go
3
81.23
18.22% pkg/vmcp/server/server.go
Jobs
ID Job ID Ran Files Coverage
1 19304282141.1 12 Nov 2025 04:27PM UTC 380
48.91
GitHub Action Run
Source Files on build 19304282141
  • Tree
  • List 380
  • Changed 6
  • Source Changed 4
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #19304282141
  • 18fa987b on github
  • Prev Build on main (#19302792233)
  • Next Build on main (#19304811885)
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

© 2025 Coveralls, Inc