amazon-q-developer-cli icon indicating copy to clipboard operation
amazon-q-developer-cli copied to clipboard

q_cli_default agent override not loading custom resources

Open gogakoreli opened this issue 4 months ago • 3 comments

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

  1. Create .amazonq/cli-agents/q_cli_default.json with custom resources
  2. Run q chat
  3. 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 .json extension requirement
  • No test coverage for this feature

gogakoreli avatar Sep 17 '25 23:09 gogakoreli

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 avatar Oct 24 '25 15:10 JohnArrowwood

@JohnArrowwood yeah I opened the PR and verified the fix works, not sure why its not getting merged

gogakoreli avatar Oct 24 '25 15:10 gogakoreli

+1 plz fix

WoolenWang avatar Nov 14 '25 10:11 WoolenWang