Conversation
The existing optimizer E2E test uses the heavyweight TEI container image for its embedding server, which is slow to pull and start. This adds a parallel test that uses a lightweight fake embedding server (Python HTTP server mimicking the TEI /info and /embed endpoints) while exercising composite tool discovery and invocation through the optimizer's find_tool and call_tool meta-tools. The new DeployFakeEmbeddingServer helper can be reused by other tests that need optimizer mode without the TEI dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4059 +/- ##
==========================================
+ Coverage 68.61% 68.70% +0.08%
==========================================
Files 446 446
Lines 45435 45435
==========================================
+ Hits 31176 31215 +39
+ Misses 11850 11811 -39
Partials 2409 2409 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I was paranoid that the optimizer and composite tools is something that would break during the migration to session v2, since composite tools are handled differently than MCPServers. This PR adds an integration test that ensures the two components are wired up correctly.
find_toolandcall_toolmeta-tools using the fake embedding server.DeployFakeEmbeddingServer/CleanupFakeEmbeddingServerhelpers tohelpers.go— a Python HTTP server mimicking the TEI/infoand/embedendpoints, reusable by any test needing optimizer mode without TEI.Type of change
Test plan
Ran the new test suite against a local Kind cluster with
task operator-deploy-local:All 5 specs passed:
should only expose find_tool and call_toolshould discover backend tool via find_toolshould discover composite tool via find_toolshould invoke backend tool via call_toolshould invoke composite tool via call_toolChanges
test/e2e/thv-operator/virtualmcp/helpers.goDeployFakeEmbeddingServer,CleanupFakeEmbeddingServerhelpers andfakeEmbeddingServerScriptconstanttest/e2e/thv-operator/virtualmcp/virtualmcp_optimizer_composite_test.goDoes this introduce a user-facing change?
No