github / github/spec-kit

bug(agy): --model ignored, EXTRA_ARGS appended after --print, and --add-dir workspace not passed

オープン
#4,480 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
triage-nice-to-have
主要言語
Python
スター
137k
フォーク
12.3k
平均マージ
2日 12時間
マージ済み PR(30日)
159

説明

### Summary

In `src/specify_cli/integrations/agy/__init__.py`, `AgyIntegration.build_exec_args()` currently hardcodes ignoring the `model` parameter:

```python
def build_exec_args(
self,
prompt: str,
*,
model: str | None = None,
output_json: bool = True,
) -> list[str] | None:
# agy does not support --model or JSON output; both params are ignored
args = [self._resolve_executable(), "--print", prompt]
self._apply_extra_args_env_var(args)
return args
```

### Issues Observed

1. **`--model` is supported by `agy` CLI**:
Modern Antigravity CLI (`agy`) supports `--model ` (e.g. `agy --model claude-sonnet-4-6 -p "..."` or `agy --model gemini-3.1-pro-high -p "..."`). Because `model` is omitted from `build_exec_args`, stage-level model tiering defined in workflows (such as `.specify/workflows/...`) fails to route to the desired model, silently falling back to the user's default local model.

2. **Working directory / workspace flag**:
When `agy` is launched in headless `--print` mode, it does not automatically bind the current directory unless `--add-dir ` is passed, causing it to report:
```text
You do not currently have an active workspace open.
By default, scratch files and projects are located at: ~/.gemini/antigravity-cli/scratch
```

3. **Flag positioning before `--print`**:
Any extra args appended *after* `--print ` are treated by `agy`'s CLI parser as part of the positional prompt text rather than CLI flags. Flags (such as `--model`, `--add-dir`, `--dangerously-skip-permissions`, `--print-timeout`) should precede `--print`.

### Proposed Fix

In `AgyIntegration.build_exec_args()`:

```python
def build_exec_args(
self,
prompt: str,
*,
model: str | None = None,
output_json: bool = True,
) -> list[str] | None:
args = [self._resolve_executable()]
if model:
args.extend(["--model", model])
self._apply_extra_args_env_var(args)
args.extend(["--print", prompt])
return args
```

And in `AgyIntegration.dispatch_command()`, pass `--add-dir` with `project_root` when invoking the subprocess so `agy` recognizes the project repository workspace.

Happy to submit a PR with tests if this looks good to the maintainers!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start in src/specify_cli/integrations/agy/__init__.py by reading AgyIntegration.build_exec_args() and dispatch_command(). Verify that model and extra arguments precede --print, and that project_root is passed through --add-dir; done means the generated command routes the requested model, preserves flags, and binds the repository workspace, with tests covering these cases.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
ai, cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
76/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。