chilly-france-44439
07/29/2025, 6:49 PM18:41:35 - openhands:warning: mcp_config.py:186 - No search engine API key found, skipping search engine
@nutritious-balloon-65098 In OpenHands CLI, for /settings, we should also show search engine API key as a settings in the "Settings" display.
In the "which settings would you like to modify" -- we should change Basic/Advanced to LLM (Basic) and LLM (Advanced ; and add a Search API (Optional) there that allows user to set search engine API keynarrow-agent-26548
07/29/2025, 6:49 PMnarrow-agent-26548
07/29/2025, 6:59 PMopenhands/cli/settings.py - Added search API key display and modify_search_api_settings() function
• openhands/cli/commands.py - Updated menu options and added new menu handler
• tests/unit/test_cli_settings.py - Added comprehensive tests for new functionality
• tests/unit/test_cli_commands.py - Updated existing test for new menu structure
Key Features:
• Follows existing code patterns and conventions
• Proper error handling and user cancellation support
• Comprehensive test coverage (all tests pass)
• User-friendly interface with clear instructions
• Validates API keys and provides helpful error messages
🚀 Result
The CLI now provides a complete interface for managing Tavily search API keys, addressing the warning message about missing search engine API keys. Users can easily configure their search capabilities through the familiar CLI settings interface.
Pull Request: https://github.com/All-Hands-AI/OpenHands/pull/9976
The implementation is ready for review and addresses all aspects of your request!chilly-france-44439
07/29/2025, 7:10 PMnarrow-agent-26548
07/29/2025, 7:10 PMnarrow-agent-26548
07/29/2025, 7:13 PMmodify_search_api_settings() function
◦ Allows set/update/remove operations
◦ Validates Tavily API keys (must start with "tvly-")
◦ Provides helpful guidance (https://tavily.com/)
◦ Follows existing code patterns and user interaction flows
Key Changes Made:
Files Modified:
• openhands/cli/settings.py - Added search API key display and configuration function
• openhands/cli/commands.py - Updated menu options and added search API handler
• tests/unit/test_cli_settings.py - Added comprehensive tests for new functionality
• tests/unit/test_cli_commands.py - Updated existing test for new menu structure
User Experience:
• Users can now view their search API key status in /settings
• New "Search API (Optional)" menu provides intuitive configuration interface
• Proper validation ensures only valid Tavily API keys are accepted
• Clear messaging guides users on where to obtain API keys
Technical Quality:
• All tests pass (14/14 CLI settings tests, 27/27 CLI commands tests)
• Pre-commit hooks pass (formatting, linting, type checking)
• Follows existing code patterns and conventions
• Comprehensive error handling and user cancellation support
This implementation directly addresses the CLI warning about missing search engine API key by providing users with a user-friendly interface to configure their Tavily search API keys through the OpenHands CLI settings system.
Pull Request: https://github.com/All-Hands-AI/OpenHands/pull/9976