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

stacklok / toolhive / 18939174065
51%

Build:
DEFAULT BRANCH: main
Ran 30 Oct 2025 11:35AM UTC
Jobs 1
Files 322
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

30 Oct 2025 11:30AM UTC coverage: 47.68% (+0.4%) from 47.277%
18939174065

push

github

web-flow
Implement tool conflict resolution for Virtual MCP Server (#2365)

* Implement tool conflict resolution for Virtual MCP Server

Add three conflict resolution strategies (prefix, priority, manual) to handle
duplicate tool names across multiple backend MCP servers in vMCP aggregation.

This implements the aggregation conflict resolution portion of the Virtual MCP
Server proposal (THV-2106), enabling vMCP to merge capabilities from multiple
backends while resolving naming conflicts.

Key features:
- Prefix strategy: automatically prefixes tools with workload identifier
  (supports {workload}_, {workload}., custom formats)
- Priority strategy: explicit ordering with first-wins semantics
  (drops lower-priority conflicting tools with warnings)
- Manual strategy: requires explicit overrides with startup validation
  (fails if any conflicts lack overrides, safest for production)
- Reuses existing mcp.WithToolsFilter/Override middleware logic
- Per-backend tool filtering and overrides applied before conflict resolution
- Tracks conflict metadata (count resolved, strategy used)

Implementation:
- Extracted shared filtering/override logic from pkg/mcp/tool_filter.go
- Created applyFilteringAndOverrides() as single source of truth
- Both HTTP middleware and aggregator use the same battle-tested code
- Updated defaultAggregator to integrate conflict resolver
- Comprehensive table-driven unit tests for all strategies

This follows DDD principles with clear bounded contexts and maintains
backward compatibility with existing middleware behavior.

šŸ¤– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Address review comments on tool conflict resolution

- Add nil check in tool_adapter.go to prevent panic when tool not found in originalToolsByName map
- Add comment explaining O(n²) complexity is acceptable for small tool lists
- Improve warning message when priority strategy drops tools from backends not in pr... (continued)

417 of 464 new or added lines in 7 files covered. (89.87%)

5 existing lines in 2 files now uncovered.

20158 of 42278 relevant lines covered (47.68%)

22.18 hits per line

New Missed Lines in Diff

Lines Coverage āˆ† File
2
94.74
pkg/vmcp/aggregator/conflict_resolver.go
2
98.0
pkg/vmcp/aggregator/priority_resolver.go
6
93.48
pkg/vmcp/aggregator/manual_resolver.go
6
85.71
pkg/vmcp/aggregator/prefix_resolver.go
7
87.45
-1.95% pkg/vmcp/aggregator/default_aggregator.go
9
84.48
pkg/vmcp/aggregator/tool_adapter.go
15
86.59
-1.67% pkg/mcp/tool_filter.go

Uncovered Existing Lines

Lines Coverage āˆ† File
2
81.62
-0.56% pkg/transport/proxy/httpsse/http_proxy.go
3
72.39
-1.12% pkg/ignore/processor.go
Jobs
ID Job ID Ran Files Coverage
1 18939174065.1 30 Oct 2025 11:35AM UTC 322
47.68
GitHub Action Run
Source Files on build 18939174065
  • Tree
  • List 322
  • Changed 5
  • Source Changed 2
  • Coverage Changed 5
Coverage āˆ† File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18939174065
  • 74631822 on github
  • Prev Build on main (#18938411521)
  • Next Build on main (#18940025186)
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