fix(agy): support --model, --add-dir workspace, and pre-prompt extra args - #4481
fix(agy): support --model, --add-dir workspace, and pre-prompt extra args#4481timoyan wants to merge 4 commits into
Conversation
|
Thanks — and this is a model report→fix loop (#4480 + this), with genuinely exemplary disclosure and the bugs verified on a real project. The |
There was a problem hiding this comment.
🟡 Changes recommended
The production dispatch path lacks a regression test confirming that it forwards the workspace argument.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes agy workflow dispatch by correctly ordering CLI flags and supplying workspace context.
Changes:
- Adds
--modeland--add-dirsupport. - Places extra arguments before
--print. - Expands argument-building tests.
File summaries
| File | Description |
|---|---|
src/specify_cli/integrations/agy/__init__.py |
Updates argument construction and dispatch. |
tests/integrations/test_integration_agy.py |
Tests flag inclusion and ordering. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
As suggested in PR github#4481, this removes the dispatch_command override in AgyIntegration to avoid duplicating subprocess and timeout logic. Instead, project_root is now threaded through IntegrationBase.dispatch_command directly into build_exec_args. All other integration subclasses have been updated to accept **kwargs to maintain signature compatibility.
@mnriem I think you're right, we could have project_root from base. Please check the latest commmit. :) |
|
This is a great generalization — threading |
d32a534 to
441254e
Compare
|
@mnriem Rebased onto the latest main, threaded project_root across base classes and all integrations, and added a regression test for dispatching project_root as --add-dir. All integration and base test suites are green locally! |
|
Thanks — the base-class threading is the right call and it's actually leaner than the per-integration override. Rebased and green-locally is great, but given this touches ~15 integrations I want a full CI run across the matrix (macOS/Windows have surprised us elsewhere today) plus a proper review of the base change before merge — I'll trigger CI now. Nothing needed from you meanwhile. |
441254e to
12a3fd5
Compare
|
@mnriem sorry there is Ruff error in opencode integration. I just submit the fix. |
There was a problem hiding this comment.
🟡 Changes recommended
Workflow prompt steps still omit project_root, so agy can retain the workspace failure.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 18/18 changed files
- Comments generated: 1
- Review effort level: Balanced
|
Good — the base-class threading and rebase look right, and CI's now running. One real gap the re-review found before merge: workflow |
12a3fd5 to
10adae1
Compare
|
@mnriem Changes pushed, please verify it in latest commit :) |
…ot through base dispatch_command
…ation env vars in tests - scripts/powershell/common.ps1: Enforce [Console]::OutputEncoding and $OutputEncoding as UTF-8. On Windows hosts with non-UTF-8/OEM code pages (such as CP950/Big5), PowerShell stdout would otherwise output non-ASCII characters (e.g. arrows in templates) using the system code page, causing UnicodeDecodeError when captured by external runners. - tests/conftest.py: Drop ambient SPECKIT_INTEGRATION_*_EXTRA_ARGS and SPECKIT_INTEGRATION_*_EXECUTABLE environment variables in the autouse _strip_specify_env fixture to prevent host configuration leakage into integration argument-building tests. Assisted-by: Antigravity (model: Gemini 3.8 Flash, supervised)
10adae1 to
e49845b
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Relative workspace roots resolve incorrectly for agy, and the unrelated PowerShell encoding change should be removed or separated.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 23/23 changed files
- Comments generated: 2
- Review effort level: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@mnriem Following Copilot’s suggestions, I submitted two changes: one for encoding in testing and another for the project_root path. Sorry for the back and forth. |
|
I discussed this with my AI coding assistant (Antigravity), and it correctly identified that when engine dispatch works as expected.
|
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.