q_cli_default agent override not loading custom resources
Bug Description
The q_cli_default agent override feature documented in default-agent-behavior.md is not working as expected. When a custom q_cli_default.json file is placed in .amazonq/cli-agents/, it is ignored and the built-in default agent is used instead.
Expected Behavior
When a q_cli_default.json file exists in the local or global agent directories, it should completely override the built-in default agent configuration, including custom resources, tools, and settings.
Actual Behavior
The custom q_cli_default.json file is ignored, and the built-in default agent with hardcoded resources (AmazonQ.md, README.md, etc.) is used instead.
Root Cause
In crates/chat-cli/src/cli/agent/mod.rs around line 688, the code directly calls Agent::default() without first checking if a q_cli_default.json file exists.
Reproduction Steps
- Create
.amazonq/cli-agents/q_cli_default.jsonwith custom resources - Run
q chat - Check
/context show- shows built-in resources instead of custom ones
Impact
This prevents teams from setting up workspace-specific default agents that automatically load project context and rules when anyone runs q chat in their workspace.
Additional Issues
- Documentation is missing the
.jsonextension requirement - No test coverage for this feature
Please fix. I lost a lot of time trying to understand what I was doing wrong, why it wasn't working. I'm sure q can help write the fix...
@JohnArrowwood yeah I opened the PR and verified the fix works, not sure why its not getting merged
+1 plz fix