@@ -557,6 +557,7 @@ def test_uses_brave_when_brave_key_is_set(self, monkeypatch: pytest.MonkeyPatch)
557557 monkeypatch .setenv ("BRAVE_SEARCH_API_KEY" , "brave-key" )
558558 monkeypatch .delenv ("TAVILY_SEARCH_API_KEY" , raising = False )
559559 monkeypatch .delenv ("BING_API_KEY" , raising = False )
560+ monkeypatch .delenv ("NIMBLE_API_KEY" , raising = False )
560561
561562 with patch ("ogx.cli.stack.lets_go.cprint" ) as mock_cprint :
562563 _add_file_search_and_responses (
@@ -571,13 +572,14 @@ def test_uses_brave_when_brave_key_is_set(self, monkeypatch: pytest.MonkeyPatch)
571572
572573 web_search_providers = [
573574 p
574- for p in ["brave-search" , "tavily-search" , "bing-search" ]
575+ for p in ["brave-search" , "tavily-search" , "bing-search" , "nimble-search" ]
575576 if any (p in str (call ) for call in mock_cprint .call_args_list )
576577 ]
577578 # Only brave should be added (env var set)
578579 assert "brave-search" in web_search_providers
579580 assert "tavily-search" not in web_search_providers
580581 assert "bing-search" not in web_search_providers
582+ assert "nimble-search" not in web_search_providers
581583
582584 def test_falls_back_to_tavily_when_only_tavily_key_set (self , monkeypatch : pytest .MonkeyPatch ):
583585 from ogx .cli .stack .lets_go import _add_file_search_and_responses
@@ -586,6 +588,7 @@ def test_falls_back_to_tavily_when_only_tavily_key_set(self, monkeypatch: pytest
586588 monkeypatch .delenv ("BRAVE_SEARCH_API_KEY" , raising = False )
587589 monkeypatch .setenv ("TAVILY_SEARCH_API_KEY" , "tavily-key" )
588590 monkeypatch .delenv ("BING_API_KEY" , raising = False )
591+ monkeypatch .delenv ("NIMBLE_API_KEY" , raising = False )
589592
590593 with patch ("ogx.cli.stack.lets_go.cprint" ) as mock_cprint :
591594 _add_file_search_and_responses (
@@ -606,6 +609,8 @@ def test_falls_back_to_tavily_when_only_tavily_key_set(self, monkeypatch: pytest
606609 provider_ids_in_calls .add ("tavily-search" )
607610 if "bing-search" in str (call ):
608611 provider_ids_in_calls .add ("bing-search" )
612+ if "nimble-search" in str (call ):
613+ provider_ids_in_calls .add ("nimble-search" )
609614
610615 # Only tavily is added since only its env var is set
611616 assert provider_ids_in_calls == {"tavily-search" }
@@ -617,6 +622,7 @@ def test_selects_first_with_api_key(self, monkeypatch: pytest.MonkeyPatch):
617622 monkeypatch .setenv ("BRAVE_SEARCH_API_KEY" , "brave-key" )
618623 monkeypatch .setenv ("TAVILY_SEARCH_API_KEY" , "tavily-key" )
619624 monkeypatch .setenv ("BING_API_KEY" , "bing-key" )
625+ monkeypatch .setenv ("NIMBLE_API_KEY" , "nimble-key" )
620626
621627 with patch ("ogx.cli.stack.lets_go.cprint" ) as mock_cprint :
622628 _add_file_search_and_responses (
@@ -637,16 +643,18 @@ def test_selects_first_with_api_key(self, monkeypatch: pytest.MonkeyPatch):
637643 provider_ids_in_calls .add ("tavily-search" )
638644 if "bing-search" in str (call ):
639645 provider_ids_in_calls .add ("bing-search" )
646+ if "nimble-search" in str (call ):
647+ provider_ids_in_calls .add ("nimble-search" )
640648
641- # All three have keys, all three should be added
642- assert provider_ids_in_calls == {"brave-search" , "tavily-search" , "bing-search" }
649+ # All four have keys, all four should be added
650+ assert provider_ids_in_calls == {"brave-search" , "tavily-search" , "bing-search" , "nimble-search" }
643651
644652 def test_no_web_search_when_no_key_set (self , monkeypatch : pytest .MonkeyPatch ):
645653 from ogx .cli .stack .lets_go import _add_file_search_and_responses
646654 from ogx .core .datatypes import StackConfig
647655
648656 # Clear env vars to ensure no keys are set
649- for var in ("BRAVE_SEARCH_API_KEY" , "TAVILY_SEARCH_API_KEY" , "BING_API_KEY" ):
657+ for var in ("BRAVE_SEARCH_API_KEY" , "TAVILY_SEARCH_API_KEY" , "BING_API_KEY" , "NIMBLE_API_KEY" ):
650658 monkeypatch .delenv (var , raising = False )
651659
652660 with patch ("ogx.cli.stack.lets_go.cprint" ) as mock_cprint :
@@ -668,7 +676,7 @@ def test_duplicate_providers_when_already_configured(self, monkeypatch: pytest.M
668676 from ogx .cli .stack .lets_go import _add_file_search_and_responses
669677 from ogx .core .datatypes import Provider , StackConfig
670678
671- for var in ("BRAVE_SEARCH_API_KEY" , "TAVILY_SEARCH_API_KEY" , "BING_API_KEY" ):
679+ for var in ("BRAVE_SEARCH_API_KEY" , "TAVILY_SEARCH_API_KEY" , "BING_API_KEY" , "NIMBLE_API_KEY" ):
672680 monkeypatch .delenv (var , raising = False )
673681
674682 initial_providers = [
@@ -690,6 +698,7 @@ def test_duplicate_providers_when_already_configured(self, monkeypatch: pytest.M
690698 "remote::brave-search" ,
691699 "remote::tavily-search" ,
692700 "remote::bing-search" ,
701+ "remote::nimble-search" ,
693702 }
694703 web_search_providers = [p for p in config .providers ["tool_runtime" ] if p .provider_type in web_search_types ]
695704 assert len (web_search_providers ) == 1
0 commit comments