github / github/spec-kit

[Bug]: Amp dispatch sends `-p`/`--model`/`--output-format` — none of these exist in the Amp CLI

Đang mở Phù hợp với người mới
#4,580 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage-nice-to-have
Ngôn ngữ chính
Python
Star
137k
Fork
12.3k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
159

Mô tả

### Bug Description

`AmpIntegration` never overrides `build_exec_args()`, so it inherits the generic implementation from `MarkdownIntegration` (`src/specify_cli/integrations/base.py:1062`), which emits:

```
-p --model --output-format json
```

None of those three flags exist in the Amp CLI. Every workflow `command:`/`prompt:` step dispatching to Amp fails immediately at argument parsing, even with `amp` installed and authenticated.

This is the `amp` row of the audit in #2416, which lists it first among the integrations still inheriting the unverified `-p / --model / --output-format json` pattern.

### Steps to Reproduce

1. Generate the argv Spec Kit dispatches with, from a source checkout at `main` (`d848fb4`):

```console
$ uv run python -c "from specify_cli.integrations.amp import AmpIntegration; print(AmpIntegration().build_exec_args('hello', model='gpt-5', output_json=True))"
['amp', '-p', 'hello', '--model', 'gpt-5', '--output-format', 'json']
```

2. Run exactly that against the real Amp CLI:

```console
$ amp -p "hello" --model gpt-5 --output-format json
Error: error: unknown option '-p'
$ echo $?
1
```

3. Confirm the flags Amp actually accepts:

```console
$ amp --help | grep -E '^\s+-x|^\s+--stream-json$'
-x, --execute [message]
--stream-json
```

### Expected Behavior

Spec Kit dispatches to Amp using Amp's documented execute-mode interface, so the command runs:

```
amp --execute [--stream-json]
```

### Actual Behavior

The dispatch fails at argument parsing with `error: unknown option '-p'` (exit 1). The agent is never invoked.

Checked against `amp --help` (v0.0.1789372854-ge954c8):

| Flag Spec Kit sends | Present in Amp CLI? | Amp's actual flag |
|---|---|---|
| `-p ` | No | `-x, --execute [message]` |
| `--model ` | No | none — `-m, --mode` sets an *agent mode* (`low`/`medium`/`high`/`ultra`), not a model name |
| `--output-format json` | No | `--stream-json` (used with `--execute`) |

### Specify CLI Version

1.0.7.dev0 (source checkout, git `d848fb4`)

### AI Agent

Amp

### Operating System

Windows 11

### Python Version

3.14.7

### Error Logs

```shell
$ amp -p "hello" --model gpt-5 --output-format json
Error: error: unknown option '-p'
```

For contrast, the proposed argv parses and proceeds (it only stops at the login prompt, because this machine has no API key):

```shell
$ amp --execute "hello" --stream-json
No API key found. Starting login flow...
To log in, visit:
https://auth.ampcode.com/device?user_code=...
```

### Additional Context

Amp CLI version tested: `0.0.1789372854-ge954c8`, installed via `npx @sourcegraph/amp`.

Documentation: [execute mode](https://ampcode.com/docs/cli/execute-mode) documents `-x, --execute`; [streaming JSON](https://ampcode.com/docs/cli/streaming-json) states "Use `--stream-json` with `--execute` to output streaming JSON instead of plain text."

On the `model` parameter: Amp exposes no model-selection flag. `-m, --mode` takes an agent mode (`low`, `medium`, `high`, `ultra`, or a plugin mode) which "controls the model, system prompt, and tool selection" — it is not a model identifier, so passing Spec Kit's `model` value through to `-m` would be incorrect. A fix should drop the model flag rather than remap it.

Same fix shape as the existing one-off overrides for opencode (#2409) and goose (#3781). Happy to open a PR.

**AI Assistance Disclosure:** AI assistance was used for the source inspection, reproduction, and drafting of this report. All CLI output above was executed and captured on the reporting machine.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with AmpIntegration and compare its inherited build_exec_args() in src/specify_cli/integrations/base.py:1062 against the Amp CLI help output. Verify that dispatch uses Amp's documented execute and streaming options, omits the unsupported model argument, and produces an argv that runs past argument parsing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
84/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.