Fix q_cli_default agent override not loading custom resources #2943
+54
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2922
This PR fixes the
q_cli_default
agent override feature that was not working as documented. The issue was that the code was directly usingAgent::default()
instead of checking for customq_cli_default.json
files.Changes Made
Code Fix
crates/chat-cli/src/cli/agent/mod.rs
(lines ~689-693)Agent::get_agent_by_name(os, DEFAULT_AGENT_NAME)
check before falling back toAgent::default()
q_cli_default.json
files from local/global directoriesDocumentation Fix
docs/default-agent-behavior.md
.json
extension and clarified behaviorTest Coverage
crates/chat-cli/src/cli/agent/mod.rs
test_q_cli_default_override
Testing
The new test:
Use Case
This enables teams to automatically load project-specific context when anyone runs
q chat
in their workspace, improving developer experience and ensuring consistent AI assistance across the team.