aws / aws/amazon-q-developer-cli
docs: Mismatch between agent documentation and current functionality. The name field is no longer optional.
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
Documentation file [agent-format.md](https://github.com/aws/amazon-q-developer-cli/blob/main/docs/agent-format.md) specifies the agent field "name" to be optional.
The "name" field for an agent has become mandatory since this commit:
https://github.com/aws/amazon-q-developer-cli/commit/dc0974fad9c5da624c77311d536069f082698a94#diff-61df6179f46d679df0c7da318067babd72d265d8958e1b94e3a990de0bfba45fL123-L124
The "/agent generate" command also requires providing a name:
https://github.com/aws/amazon-q-developer-cli/commit/a8afb479f8cbb9390e28560ccc198943316ad2c1#diff-f6d402f6ca61a5601d188759a5d5246ceb57016fa6744f5bbbdec85180ff7a2cR1606
Attempting to use an agent json file with no "name" field results in the following on Q startup:
```bash
mainuser@mainpc:~$ q
Error: Json supplied at /home/mainuser/.aws/amazonq/cli-agents/santas-little-helper.json is invalid: missing field `name` at line 7 column 1
```
Similarly, for "/agent generate":
```bash
> /agent generate
✔ Enter agent name: ·
✔ Enter agent description: · example
✔ Agent scope · Global (all workspaces)
Agent name and description cannot be empty.
```
Then in [other documentation which gives examples](https://github.com/aws/amazon-q-developer-cli/blob/main/docs/agent-file-locations.md#example-usage) of agent usage, it lacks the "name" field. Following these examples will give the same error:
```bash
mainuser@mainpc:~/example_project$ mkdir -p .amazonq/cli-agents
cat > .amazonq/cli-agents/project-helper.json << 'EOF'
{
"description": "Helper agent for this specific project",
"tools": ["fs_read", "fs_write", "execute_bash"],
"resources": [
"file://README.md",
"file://docs/**/*.md"
]
}
EOF
mainuser@mainpc:~/example_project$ q
Error: Json supplied at /home/mainuser/example_project/.amazonq/cli-agents/project-helper.json is invalid: missing field `name` at line 8 column 1
```
Contributor guide
Assessment
This issue has not been assessed yet.