You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhancement Request: Implement dynamic agent discovery for agent validation system to replace the need for static agent registries and integrate with Claude Code's actual available agents.
This issue addresses Bug #2 from Issue #56: Missing Agent Name Validation
Current State (Accurate Assessment)
NO Agent Validation Currently Exists
The create_task tool in src/tools/create-task.ts accepts ANY agent name without validation
Users can create tasks for non-existent agents (e.g., 'nonexistent-agent', 'hacker-agent')
No protection against invalid or malicious agent names
// Current problematic code in create-task.tsconstagent=validateRequiredString(options.agent,'agent');// No further agent validation - accepts any string!
Test Evidence:
create_task accepts 'nonexistent-agent' without error
No validation against available Claude Code agents
Security risk: path traversal and injection vulnerabilities possible
Proposed Solution
Goal: Dynamic Agent Discovery System
Implement agent validation that discovers truly available agents from Claude Code environment, NOT from static lists or /comm directories.
Key Insight: getAllAgents() Problem
Current getAllAgents() in src/utils/task-manager.ts scans /comm directories for agent folders - this is WRONG because:
/comm contains task storage, not agent availability
An agent can exist without having any tasks yet
Agent availability should come from Claude Code's agent system (/agents command equivalent)
Technical Requirements
1. Real Agent Discovery
// Need to discover agents from Claude Code system, not filesystemfunctiondiscoverAvailableAgents(): string[]{// Integration with Claude Code's agent discovery// NOT scanning /comm directories// Possibly via /agents command equivalent or MCP integration}
2. Non-Breaking Implementation
// Add validation without breaking existing APIexportfunctionvalidateAgent(agent: string): void{// Basic security checks (path traversal, injection)// Dynamic agent existence validation// Helpful suggestions from actual available agents}
Dependencies: Research into Claude Code agent discovery mechanisms
Implementation Notes
This enhancement addresses Bug #2 from Issue #56: Missing Agent Name Validation. Currently, the MCP server accepts any agent name without validation, creating both security risks and poor user experience when invalid agents are used.
Summary
Enhancement Request: Implement dynamic agent discovery for agent validation system to replace the need for static agent registries and integrate with Claude Code's actual available agents.
This issue addresses Bug #2 from Issue #56: Missing Agent Name Validation
Current State (Accurate Assessment)
NO Agent Validation Currently Exists
create_tasktool insrc/tools/create-task.tsaccepts ANY agent name without validationCurrent Code State:
src/tools/create-task.tsline 291: Only basic string validation viavalidateRequiredString()Problem Identified in Issue #56
Bug #2 Analysis:
Test Evidence:
create_taskaccepts 'nonexistent-agent' without errorProposed Solution
Goal: Dynamic Agent Discovery System
Implement agent validation that discovers truly available agents from Claude Code environment, NOT from static lists or
/commdirectories.Key Insight:
getAllAgents()ProblemCurrent
getAllAgents()insrc/utils/task-manager.tsscans/commdirectories for agent folders - this is WRONG because:/commcontains task storage, not agent availability/agentscommand equivalent)Technical Requirements
1. Real Agent Discovery
2. Non-Breaking Implementation
3. Performance & Reliability
Investigation Findings
From Issue #56 Bug Analysis:
Current Working Evidence:
tests/unit/tools/create-task.test.ts- Tests pass with any agent nameImplementation Strategy
Phase 1: Research Agent Discovery
/agentscommand implementation/commscanning)Phase 2: Security-First Validation
Phase 3: Dynamic Discovery Integration
Phase 4: Testing & Documentation
Technical Considerations
Security Requirements
Performance Requirements
validateAgent()signatureDiscovery Research Needed
Success Criteria
Functional Goals
User Experience Goals
Technical Goals
Related Context
Implementation Notes
This enhancement addresses Bug #2 from Issue #56: Missing Agent Name Validation. Currently, the MCP server accepts any agent name without validation, creating both security risks and poor user experience when invalid agents are used.