Behavior
When using --config-dir to point to a directory containing agent files, the CLI finds the agent (no "No such agent" error) but silently ignores the agent's instructions. The agent's system prompt is not applied.
Steps to reproduce
# 1. Create agent in a custom config dir
mkdir -p /tmp/copilot-test/.github/agents
cat > /tmp/copilot-test/.github/agents/dummy-test.agent.md << 'EOF'
---
description: A dummy test agent
---
You are a dummy test agent. Reply with ONLY: DUMMY_AGENT_OK
EOF
# 2. Run with --config-dir (from a workspace with no agents)
cd /some/empty/workspace
copilot --yolo --config-dir /tmp/copilot-test --agent dummy-test -p "hello"
# Result: "Hello! How can I help?" — agent instructions NOT applied, no error
# 3. Compare: nonexistent agent correctly errors
copilot --yolo --agent nonexistent-xyz -p "hello"
# Result: "No such agent: nonexistent-xyz, available: "
# 4. Compare: same agent in ~/.copilot/agents/ works correctly
mkdir -p ~/.copilot/agents
cp /tmp/copilot-test/.github/agents/dummy-test.agent.md ~/.copilot/agents/
copilot --yolo --agent dummy-test -p "hello"
# Result: "DUMMY_AGENT_OK" — agent instructions applied correctly
Expected behavior
Either:
--config-dir should include <config-dir>/.github/agents/ (or <config-dir>/agents/) as an agent discovery path AND load the instructions, or
- If
--config-dir is not intended for agent discovery, the CLI should return "No such agent" instead of silently running without the agent's instructions.
Environment
copilot CLI installed via Homebrew (/opt/homebrew/bin/copilot)
- macOS
- March 2026
Behavior
When using
--config-dirto point to a directory containing agent files, the CLI finds the agent (no "No such agent" error) but silently ignores the agent's instructions. The agent's system prompt is not applied.Steps to reproduce
Expected behavior
Either:
--config-dirshould include<config-dir>/.github/agents/(or<config-dir>/agents/) as an agent discovery path AND load the instructions, or--config-diris not intended for agent discovery, the CLI should return "No such agent" instead of silently running without the agent's instructions.Environment
copilotCLI installed via Homebrew (/opt/homebrew/bin/copilot)