@@ -674,19 +674,31 @@ def test_agy_without_ai_skills_fails(self):
674674
675675 def test_interactive_agy_without_ai_skills_prompts_skills (self , monkeypatch ):
676676 """Interactive selector returning agy without --ai-skills should automatically enable --ai-skills."""
677- import specify_cli
678677 from typer .testing import CliRunner
679-
680- # Mock select_with_arrows to simulate the user picking 'agy' for AI, but default otherwise
681- original_select_with_arrows = specify_cli .select_with_arrows
682678
679+ # Mock select_with_arrows to simulate the user picking 'agy' for AI,
680+ # and return a deterministic default for any other prompts to avoid
681+ # calling the real interactive implementation.
683682 def _fake_select_with_arrows (* args , ** kwargs ):
684683 options = kwargs .get ("options" )
685684 if options is None and len (args ) >= 1 :
686685 options = args [0 ]
686+
687+ # If the options include 'agy', simulate selecting it.
687688 if isinstance (options , dict ) and "agy" in options :
688689 return "agy"
689- return original_select_with_arrows (* args , ** kwargs )
690+ if isinstance (options , (list , tuple )) and "agy" in options :
691+ return "agy"
692+
693+ # For any other prompt, return a deterministic, non-interactive default:
694+ # pick the first option if available.
695+ if isinstance (options , dict ) and options :
696+ return next (iter (options .keys ()))
697+ if isinstance (options , (list , tuple )) and options :
698+ return options [0 ]
699+
700+ # If no options are provided, fall back to None (should not occur in normal use).
701+ return None
690702
691703 monkeypatch .setattr ("specify_cli.select_with_arrows" , _fake_select_with_arrows )
692704
0 commit comments