Skip to content

fix: Resolve tool names in optim.find_tool to match routing table#3337

Merged
therealnb merged 3 commits intojerm/2026-01-13-optimizer-in-vmcpfrom
research-141
Jan 19, 2026
Merged

fix: Resolve tool names in optim.find_tool to match routing table#3337
therealnb merged 3 commits intojerm/2026-01-13-optimizer-in-vmcpfrom
research-141

Conversation

@therealnb
Copy link

Resolve tool names dynamically in optim.find_tool by looking them up in the routing table. This ensures returned tool names match the keys used in the routing table, allowing optim.call_tool to successfully find and execute tools.

Previously, optim.find_tool returned original tool names from the database, but optim.call_tool expected resolved names (after conflict resolution) that match routing table keys, causing 'tool not found in routing table' errors.

Changes:

  • Add resolveToolName() helper to lookup resolved names in routing table
  • Modify convertSearchResultsToResponse() to accept routing table and resolve names
  • Update createFindToolHandler() to retrieve routing table from context

Fixes https://github.com/StacklokLabs/research/issues/141

Resolve tool names dynamically in optim.find_tool by looking them up
in the routing table. This ensures returned tool names match the keys
used in the routing table, allowing optim.call_tool to successfully
find and execute tools.

Previously, optim.find_tool returned original tool names from the
database, but optim.call_tool expected resolved names (after conflict
resolution) that match routing table keys, causing 'tool not found in
routing table' errors.

Changes:
- Add resolveToolName() helper to lookup resolved names in routing table
- Modify convertSearchResultsToResponse() to accept routing table and resolve names
- Update createFindToolHandler() to retrieve routing table from context

Fixes https://github.com/StacklokLabs/research/issues/141
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Jan 19, 2026
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Jan 19, 2026
The test was failing because registry.List() returns backends in a
non-deterministic order. Use gomock.Do() to verify backend contents
regardless of order instead of expecting an exact slice match.
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Jan 19, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 0% with 27 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (jerm/2026-01-13-optimizer-in-vmcp@b8c9512). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/vmcp/optimizer/optimizer.go 0.00% 27 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##             jerm/2026-01-13-optimizer-in-vmcp    #3337   +/-   ##
====================================================================
  Coverage                                     ?   62.25%           
====================================================================
  Files                                        ?      376           
  Lines                                        ?    37018           
  Branches                                     ?        0           
====================================================================
  Hits                                         ?    23045           
  Misses                                       ?    12115           
  Partials                                     ?     1858           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@therealnb therealnb merged commit c1803da into jerm/2026-01-13-optimizer-in-vmcp Jan 19, 2026
26 checks passed
@therealnb therealnb deleted the research-141 branch January 19, 2026 12:49
therealnb pushed a commit that referenced this pull request Jan 20, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 20, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 20, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 21, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 21, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 21, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 21, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 26, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 26, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 26, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 26, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 28, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
therealnb pushed a commit that referenced this pull request Jan 28, 2026
)

* fix: Resolve tool names in optim.find_tool to match routing table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant