Summary
cortex acp --agent <name> hardcodes the agent registry path to ~/.cortex instead of using the CORTEX_HOME environment variable. Agents stored in the custom home directory are never found.
Steps to Reproduce
# Create an agent in the custom CORTEX_HOME
mkdir -p /tmp/custom_cortex_home/agents/testacpagent
cat > /tmp/custom_cortex_home/agents/testacpagent/AGENT.md << 'EOF'
---
name: testacpagent
description: Test agent
---
EOF
# Run with CORTEX_HOME pointing to the custom directory
CORTEX_HOME=/tmp/custom_cortex_home CORTEX_API_KEY=ctx-fake cortex acp --agent testacpagent
Expected Behavior
cortex acp --agent testacpagent should find the agent in $CORTEX_HOME/agents/testacpagent/.
Actual Behavior
Error: Agent not found: 'testacpagent'. Use 'cortex agent list' to see available agents.
The command fails because it looks in ~/.cortex/agents/ instead of /tmp/custom_cortex_home/agents/.
Screenshot

Root Cause
File: src/cortex-cli/src/acp_cmd.rs, lines 61–63
// BUGGY — hardcodes ~/.cortex, ignores CORTEX_HOME
let cortex_home = dirs::home_dir()
.map(|h| h.join(".cortex"))
.ok_or_else(|| anyhow::anyhow!("Could not determine home directory"))?;
The correct pattern used by other commands is:
// CORRECT — respects CORTEX_HOME
let cortex_home = crate::utils::paths::get_cortex_home();
The get_cortex_home() function in utils/paths.rs properly checks the CORTEX_HOME environment variable. The acp_cmd.rs bypasses this and always uses ~/.cortex.
Version
cortex v0.0.7
Summary
cortex acp --agent <name>hardcodes the agent registry path to~/.cortexinstead of using theCORTEX_HOMEenvironment variable. Agents stored in the custom home directory are never found.Steps to Reproduce
Expected Behavior
cortex acp --agent testacpagentshould find the agent in$CORTEX_HOME/agents/testacpagent/.Actual Behavior
The command fails because it looks in
~/.cortex/agents/instead of/tmp/custom_cortex_home/agents/.Screenshot
Root Cause
File:
src/cortex-cli/src/acp_cmd.rs, lines 61–63The correct pattern used by other commands is:
The
get_cortex_home()function inutils/paths.rsproperly checks theCORTEX_HOMEenvironment variable. Theacp_cmd.rsbypasses this and always uses~/.cortex.Version
cortex v0.0.7