Skip to content

Conversation

gogakoreli
Copy link

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 using Agent::default() instead of checking for custom q_cli_default.json files.

Changes Made

Code Fix

  • File: crates/chat-cli/src/cli/agent/mod.rs (lines ~689-693)
  • Change: Added Agent::get_agent_by_name(os, DEFAULT_AGENT_NAME) check before falling back to Agent::default()
  • Impact: Now properly loads custom q_cli_default.json files from local/global directories

Documentation Fix

  • File: docs/default-agent-behavior.md
  • Change: Added missing .json extension and clarified behavior
  • Impact: Developers now know the correct filename format

Test Coverage

  • File: crates/chat-cli/src/cli/agent/mod.rs
  • Change: Added comprehensive test test_q_cli_default_override
  • Impact: Verifies fix works and prevents regression

Testing

The new test:

  • Fails without the fix (uses built-in default)
  • Passes with the fix (loads custom agent)
  • Uses proper patterns (no hardcoded paths/values)

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.

gogakoreli and others added 2 commits September 17, 2025 16:56
- Add check for q_cli_default.json files before falling back to Agent::default()
- Fix documentation to include missing .json extension
- Add comprehensive test to verify the fix works
- Resolves issue where custom q_cli_default agents were ignored

The q_cli_default override feature was not working as documented.
The code was directly using Agent::default() instead of checking
for custom q_cli_default.json files in local/global directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

q_cli_default agent override not loading custom resources
1 participant