fix(agy): support --model, --add-dir workspace, and pre-prompt extra args - #4481
Open
timoyan wants to merge 1 commit into
Open
fix(agy): support --model, --add-dir workspace, and pre-prompt extra args#4481timoyan wants to merge 1 commit into
timoyan wants to merge 1 commit into
Conversation
…args Three bugs fixed in AgyIntegration: 1. --model was silently ignored agy >=1.20 supports `agy --model <name> --print <prompt>`. build_exec_args() now passes --model before --print when model is set. 2. EXTRA_ARGS were appended after --print (swallowed as prompt text) agy treats every token after --print as part of the prompt string, not as CLI flags. Operator flags from SPECKIT_INTEGRATION_AGY_EXTRA_ARGS (e.g. --dangerously-skip-permissions, --print-timeout) were silently absorbed into the prompt and had no effect. Fixed: extra args are now inserted before --print. 3. Workspace was not passed to agy (no active workspace error) The workflow engine sets cwd=project_root for the subprocess but agy does not read cwd as its workspace root. Without --add-dir, agy falls back to its own scratch directory, cannot locate .agents/skills/, and reports no active workspace -- making all installed Spec Kit skills invisible. Fixed: build_exec_args() now accepts project_root and injects --add-dir <project_root> before --print when project_root is given. dispatch_command() is overridden in AgyIntegration to thread project_root through to build_exec_args(). Flag order guarantee: agy --model <m> --add-dir <d> <EXTRA_ARGS> --print <prompt> Fixes github#4480
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three bugs in
AgyIntegrationthat together preventedspecify workflow runfrom working correctly withagy. Closes #4480.Bugs Fixed
1.
--modelwas silently ignoredbuild_exec_args()had a comment# agy does not support --model ... both params are ignoredand hardcoded no--modelflag.agy >=1.20fully supportsagy --model <name> --print <prompt>. Workflow YAMLmodel:pins had no effect.Fix: Pass
--model <model>before--printwhenmodelis set.2.
EXTRA_ARGSwere appended after--print(silently absorbed as prompt text)agytreats every token after--printas part of the prompt string, not as CLI flags. Operator flags like--dangerously-skip-permissionsor--print-timeout 30mset viaSPECKIT_INTEGRATION_AGY_EXTRA_ARGSwere appended after--printand silently became part of the prompt.Fix:
_apply_extra_args_env_var()is now called beforeargs.extend(['--print', prompt]).3. No workspace passed to
agy-- 'no active workspace'The base
dispatch_command()setscwd=project_rootfor the subprocess, butagydoes not readcwdas its workspace root -- it requires an explicit--add-dir <path>flag. Without it,agyfalls back to its own scratch directory, cannot locate.agents/skills/, and reports 'no active workspace' -- making all installed Spec Kit skills invisible.Fix:
build_exec_args()now acceptsproject_root: Path | Noneand injects--add-dir <project_root>before--printwhenproject_rootis given.dispatch_command()is overridden inAgyIntegrationto threadproject_rootthrough tobuild_exec_args().Flag Order Guarantee
All flags appear before
--printsoagyparses them correctly:agy [--model <m>] [--add-dir <d>] [<EXTRA_ARGS>] --print <prompt>Tests
All 47 tests pass.
AI Assistance Disclosure
This PR was drafted with substantial AI assistance (Google Antigravity / agy). The bugs were discovered while personally running
specify workflow runagainst a real project and observing the failures firsthand. The root cause analysis, fix design, and test verification were reviewed and validated by me. AI was used to write the code, tests, commit message, and PR body.