-
Notifications
You must be signed in to change notification settings - Fork 0
Add version-based ToolHive instance selection #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When multiple ToolHive instances are running on different ports, the optimizer now automatically selects the one with the latest version. This ensures compatibility with newer features and bug fixes. Changes: - Modified `_is_toolhive_available` to return version along with availability status - Updated port scanning logic to collect and compare versions using semver - Added error handling for invalid semver strings to gracefully skip incompatible instances - Updated all test mocks to match new tuple return signature (version, bool) - Fixed 52 test cases across test_toolhive_client.py, test_toolhive_retry.py, and test_polling_manager.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Code ReviewThis PR adds version-based ToolHive instance selection. Implementation is solid with good test coverage. Strengths
Issues1. Code duplication (lines 154-205 and 396-428) 2. Inefficiency (lines 176, 406) 3. Verbosity (lines 422-423, 199-200) 4. Inconsistency PerformanceSequential port scanning could be slow with large ranges. Consider using asyncio.gather for concurrent scanning in the async version. Verdict✅ No security concerns or regressions. Recommend addressing code duplication before merge. |
|
@claude check the changes in the latest commit. Pay special attention for potential bugs or regressions with respect to main. Make your review precise and short |
|
Claude finished @aponcedeleonch's task —— View job Code ReviewReviewed commit Findings✅ Good Changes
Fix: Should be Minor Issues
Regression RiskThe bug in RecommendationFix the event loop nesting bug before merge. Otherwise the refactoring successfully addresses all previous review feedback. |
577e799 to
ce506e0
Compare
ce506e0 to
5ebbef6
Compare
|
@claude check the changes in the latest commit to see if the previous comments were addressed. Pay special attention for potential bugs or regressions with respect to main. Make your review precise and short |
|
Claude finished @aponcedeleonch's task —— View job Code Review - Latest CommitReviewed commit Todos:
Summary✅ Critical bug fixed: Line 252 now correctly calls ✅ All previous feedback addressed:
✅ No regressions detected: Error recovery flow now works correctly, allowing reconnection after ToolHive restarts. Minor observation: Line 220 still uses Verdict✅ Ready to merge - all issues from previous review resolved, no new concerns identified. |
therealnb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
I think this is all a very good argument for using another method for communicating the thv serve port to the MCP servers.
When multiple ToolHive instances are running on different ports, the optimizer now automatically selects the one with the latest version. This ensures compatibility with newer features and bug fixes.
Changes:
_is_toolhive_availableto return version along with availability statusCloses #18
🤖 Generated with Claude Code