Description
The hidden_count calculation in run_list computes agents.len() - filtered.len(), which incorrectly counts agents excluded by the --filter pattern as "hidden". The hidden count should only count agents with hidden: true, not agents that were filtered out for other reasons. This produces misleading output like "Showing 2 agents (5 hidden - use --all to show all)" when the user filters by pattern, when in fact those 5 agents aren't hidden - they just don't match the pattern. The message suggests using --all to see them, but --all only shows hidden agents, not agents excluded by pattern matching.
Error Message
N/A - produces incorrect informational message (not a crash)
Debug Logs
- Create 5 agents, none hidden
- Run
cortex agent list --filter "xyz" where no agents match
- Output shows "Showing 0 agents (5 hidden - use --all to show all)" even though no agents are actually hidden
System Information
v0.0.7, any platform
Steps to Reproduce
- Ensure you have multiple agents installed (e.g., 3-4 agents)
- Run
cortex agent list --filter "nonexistent-pattern-that-matches-nothing"
- Observe the message shows "(N hidden - use --all to show all)" where N equals the number of agents that don't match the pattern
- Run
cortex agent list --all --filter "same-pattern" and see that no hidden agents exist
Expected Behavior
The hidden count should show only agents that are actually marked as hidden (hidden: true in their config), regardless of pattern matching. When using --filter, the message should not suggest using --all to see filtered agents.
Actual Behavior
The hidden count includes all agents excluded by any filter (pattern, mode), misleadingly suggesting they are hidden agents and can be shown with --all.
Additional Context
The bug is in list.rs lines 130-135. The fix should calculate hidden_count as agents.iter().filter(|a| a.hidden).count() instead of agents.len() - filtered.len(). Note that when --all is used, hidden agents are shown in the list, so hidden_count should be 0 in that case.
Description
The
hidden_countcalculation inrun_listcomputesagents.len() - filtered.len(), which incorrectly counts agents excluded by the--filterpattern as "hidden". The hidden count should only count agents withhidden: true, not agents that were filtered out for other reasons. This produces misleading output like "Showing 2 agents (5 hidden - use --all to show all)" when the user filters by pattern, when in fact those 5 agents aren't hidden - they just don't match the pattern. The message suggests using--allto see them, but--allonly shows hidden agents, not agents excluded by pattern matching.Error Message
N/A - produces incorrect informational message (not a crash)
Debug Logs
cortex agent list --filter "xyz"where no agents matchSystem Information
v0.0.7, any platform
Steps to Reproduce
cortex agent list --filter "nonexistent-pattern-that-matches-nothing"cortex agent list --all --filter "same-pattern"and see that no hidden agents existExpected Behavior
The hidden count should show only agents that are actually marked as hidden (hidden: true in their config), regardless of pattern matching. When using --filter, the message should not suggest using --all to see filtered agents.
Actual Behavior
The hidden count includes all agents excluded by any filter (pattern, mode), misleadingly suggesting they are hidden agents and can be shown with --all.
Additional Context
The bug is in list.rs lines 130-135. The fix should calculate hidden_count as
agents.iter().filter(|a| a.hidden).count()instead ofagents.len() - filtered.len(). Note that when --all is used, hidden agents are shown in the list, so hidden_count should be 0 in that case.