From bfe4642c70573c79f19ec2a2c5cadd8380860f0c Mon Sep 17 00:00:00 2001 From: jawwad-ali Date: Sun, 5 Jul 2026 19:32:22 +0500 Subject: [PATCH] fix(integrations): agy honors SPECKIT_INTEGRATION_AGY_EXTRA_ARGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AgyIntegration.build_exec_args returned [exe, '--print', prompt] without calling _apply_extra_args_env_var(), so the documented per-integration extra-args env hook was silently dropped for agy — same class as the cursor-agent fix #3265. Append the hook after the positional prompt, matching the devin integration's shape. agy still ignores model/output as before. Co-Authored-By: Claude Fable 5 --- src/specify_cli/integrations/agy/__init__.py | 6 +++++- tests/integrations/test_integration_agy.py | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/specify_cli/integrations/agy/__init__.py b/src/specify_cli/integrations/agy/__init__.py index 33f8d17a91..a07415856e 100644 --- a/src/specify_cli/integrations/agy/__init__.py +++ b/src/specify_cli/integrations/agy/__init__.py @@ -89,7 +89,11 @@ def build_exec_args( output_json: bool = True, ) -> list[str] | None: # agy does not support --model or JSON output; both params are ignored - return [self._resolve_executable(), "--print", prompt] + args = [self._resolve_executable(), "--print", prompt] + # Honor SPECKIT_INTEGRATION_AGY_EXTRA_ARGS (operator-supplied flags), + # appended after the positional prompt like the devin integration. + self._apply_extra_args_env_var(args) + return args def setup( self, diff --git a/tests/integrations/test_integration_agy.py b/tests/integrations/test_integration_agy.py index 6ab66a0cbe..7b5580ab5a 100644 --- a/tests/integrations/test_integration_agy.py +++ b/tests/integrations/test_integration_agy.py @@ -81,6 +81,26 @@ def test_build_exec_args_ignores_output_json(self): result = i.build_exec_args("my prompt", output_json=False) assert result == ["agy", "--print", "my prompt"] + def test_build_exec_args_honors_extra_args(self, monkeypatch): + """SPECKIT_INTEGRATION_AGY_EXTRA_ARGS must be appended after the prompt. + + agy previously skipped _apply_extra_args_env_var entirely, so the + documented per-integration extra-args hook was silently ignored + (same class as the merged cursor-agent fix #3265). + """ + from specify_cli.integrations import get_integration + monkeypatch.setenv("SPECKIT_INTEGRATION_AGY_EXTRA_ARGS", "--verbose") + i = get_integration("agy") + assert i.build_exec_args("my prompt") == [ + "agy", "--print", "my prompt", "--verbose", + ] + + def test_build_exec_args_honors_executable_override(self, monkeypatch): + from specify_cli.integrations import get_integration + monkeypatch.setenv("SPECKIT_INTEGRATION_AGY_EXECUTABLE", "/custom/agy") + i = get_integration("agy") + assert i.build_exec_args("my prompt")[0] == "/custom/agy" + class TestAgyHookCommandNote: """Verify dot-to-hyphen normalization note is injected into hook sections."""