`18:41:35 - openhands:warning: mcp_config.py:186 -...
# slackbot-chatter
c
18: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 key
n
I'm on it! Xingyao Wang can track my progress here.
Summary I have successfully implemented the requested search API key settings functionality for the OpenHands CLI. Here's what was accomplished: ✅ Requirements Addressed 1. Added search engine API key to Settings display ◦ Shows "Search API Key: ********" when set ◦ Shows "Search API Key: Not Set" when empty 2. Updated menu options as requested ◦ Changed "Basic" → "LLM (Basic)" ◦ Changed "Advanced" → "LLM (Advanced)" ◦ Added new "Search API (Optional)" option 3. Implemented full search API key configuration ◦ Users can set/update their Tavily search API key ◦ Users can remove their existing API key ◦ Validates keys start with "tvly-" ◦ Provides helpful guidance on where to get keys 🔧 Technical Implementation Files Modified: •
openhands/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!
c
@nutritious-balloon-65098 i don't think we need to update config -- please follow existing patterns of other functions in settings.py # Update config if search_api_key == '': config.search_api_key = None elif search_api_key: config.search_api_key = SecretStr(search_api_key)
n
I'm on it! Xingyao Wang can continue tracking my progress here.
Summary I have successfully implemented the requested CLI settings enhancements for search engine API key configuration in OpenHands. Here's what was accomplished: ✅ Request Fulfillment Checklist: 1. ✅ Added search engine API key to Settings display ◦ Shows "Search API Key: ********" when set, "Not Set" when empty ◦ Integrated seamlessly into existing settings display format 2. ✅ Updated settings menu options ◦ Changed "Basic" → "LLM (Basic)" ◦ Changed "Advanced" → "LLM (Advanced)" ◦ Added new "Search API (Optional)" option 3. ✅ Implemented full search API key configuration ◦ Complete
modify_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