Skip to content

Commit 2e8b00c

Browse files
committed
fix: correct skills path in deprecation comment and make test mock fully deterministic
1 parent 0592517 commit 2e8b00c

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

src/specify_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ def init(
14111411

14121412
# [DEPRECATION NOTICE: Antigravity (agy)]
14131413
# As of Antigravity v1.20.5, traditional CLI "command" support was fully removed
1414-
# in favor of "Agent Skills" (Prompt.MD files within .agent/skills/).
1414+
# in favor of "Agent Skills" (SKILL.md files under <agent_folder>/skills/<skill_name>/).
14151415
# Because 'specify_cli' historically populated .agent/commands/, we now must explicitly
14161416
# enforce the `--ai-skills` flag for `agy` to ensure valid template generation.
14171417
if selected_ai == "agy" and not ai_skills:

tests/test_ai_skills.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)