Nova Coder provides advanced agent management capabilities for batch execution, history tracking, stopping agents, metrics analysis, and agent training. These commands are accessible through the agents-advanced sub-application.
Overview
The advanced agent management system allows you to:
- Execute agents in batch mode for multiple goals
- Track agent execution history
- Stop running agents when needed
- Analyze agent performance metrics
- Train agents with custom data
Commands
Batch Agent Execution
Execute an agent on multiple goals in a single batch operation.
novacoder agents-advanced batch <agent> <goals...>
Example:
novacoder agents-advanced batch coder "Fix authentication bug" "Add user profile" "Optimize database queries"
Batch Features:
- Sequential or parallel execution
- Progress tracking
- Error handling
- Result aggregation
- Performance monitoring
Agent History
View the execution history of a specific agent.
novacoder agents-advanced history <agent> --limit <n>
Example:
novacoder agents-advanced history coder --limit 20
History Includes:
- Execution timestamps
- Goals and results
- Success/failure status
- Performance metrics
- Error details
Stop Running Agent
Stop a currently running agent by its ID.
novacoder agents-advanced stop <agent_id>
Example:
novacoder agents-advanced stop agent-id-123
Stop Features:
- Graceful shutdown
- State preservation
- Cleanup operations
- Resource release
- Status reporting
Agent Metrics
View performance metrics for a specific agent.
novacoder agents-advanced metrics <agent>
Example:
novacoder agents-advanced metrics coder
Metrics Include:
- Execution count
- Success rate
- Average duration
- Resource usage
- Error frequency
Train Agent
Train an agent with custom data to improve performance.
novacoder agents-advanced train <agent> --data <path>
Example:
novacoder agents-advanced train coder --data /path/to/training-data
Training Features:
- Custom dataset support
- Performance improvement
- Model fine-tuning
- Validation testing
- Result analysis
Use Cases
Batch Processing
Process multiple goals efficiently:
novacoder agents-advanced batch coder "Fix bug #1" "Fix bug #2" "Fix bug #3"
History Review
Review agent execution history:
novacoder agents-advanced history planner --limit 50
Agent Control
Stop a misbehaving agent:
novacoder agents-advanced stop agent-id-456
Performance Analysis
Analyze agent performance:
novacoder agents-advanced metrics tester
Agent Training
Train agent with project-specific data:
novacoder agents-advanced train coder --data ./project-training-data
Implementation Details
Batch Execution
Batch execution supports:
- Sequential processing (default)
- Parallel processing (when enabled)
- Dependency tracking
- Resource management
- Error recovery
History Storage
Agent history is stored with:
- Unique execution IDs
- Timestamps and duration
- Input and output data
- Success/failure status
- Performance metrics
Agent Lifecycle
Agent lifecycle management:
- Initialization and startup
- Execution monitoring
- State management
- Graceful shutdown
- Resource cleanup
Metrics Collection
Metrics are collected for:
- Execution frequency
- Success/failure rates
- Duration statistics
- Resource consumption
- Error patterns
Training Process
Agent training involves:
- Data preprocessing
- Model fine-tuning
- Validation testing
- Performance evaluation
- Model deployment
Best Practices
- Batch Size: Use appropriate batch sizes for optimal performance
- History Review: Regularly review agent history for patterns
- Resource Monitoring: Monitor agent resource usage during execution
- Training Data: Use high-quality, relevant training data
- Metrics Analysis: Regularly analyze metrics for performance insights
Troubleshooting
Batch Execution Failures
If batch execution fails:
- Check individual goal validity
- Review error messages
- Verify agent availability
- Check resource availability
- Try smaller batch sizes
History Issues
If history is not available:
- Verify history storage configuration
- Check file permissions
- Review storage capacity
- Ensure agent has executed previously
Agent Stop Failures
If agent stop fails:
- Verify agent ID is correct
- Check agent status
- Review permissions
- Force stop if necessary
- Check for dependencies
Training Problems
If training fails:
- Verify training data format
- Check data quality
- Review error messages
- Ensure sufficient resources
- Validate agent compatibility
Advanced Features
Custom Batch Strategies
Define custom batch execution strategies:
- Priority-based ordering
- Dependency-aware scheduling
- Resource-aware allocation
- Error recovery policies
History Filtering
Filter agent history by:
- Date ranges
- Success/failure status
- Goal patterns
- Performance metrics
- Error types
Agent Groups
Group related agents for management:
- Team-based groups
- Project-specific groups
- Performance-based groups
- Custom categorization
Training Pipelines
Create automated training pipelines:
- Data preprocessing
- Model validation
- Performance testing
- Automated deployment
- Continuous improvement
Agent Types
Coder Agent
- Code generation and editing
- Bug fixing and optimization
- Refactoring and documentation
- Testing and validation
Planner Agent
- Goal decomposition
- Task planning
- Resource allocation
- Timeline estimation
Tester Agent
- Test generation
- Test execution
- Result analysis
- Bug identification
Debugger Agent
- Error analysis
- Root cause identification
- Fix suggestion
- Validation testing
Architect Agent
- System design
- Architecture planning
- Technology selection
- Implementation guidance
API Endpoints
The advanced agent management system is accessible via REST API endpoints. All endpoints have been tested and verified to be working.
Batch Agent Execution
Execute an agent on multiple goals in a single batch operation.
POST /api/agents-advanced/batch
Content-Type: application/json
x-api-token: novacoder-secure-token-2024
{
"tasks": [
{
"id": "task-1",
"agent": "coder",
"goal": "Fix authentication bug",
"context": {}
},
{
"id": "task-2",
"agent": "coder",
"goal": "Add user profile",
"context": {}
}
]
}
Response:
{
"batch_id": "batch-0",
"total_tasks": 2,
"completed_tasks": 2,
"failed_tasks": 0,
"results": [
{
"task_id": "task-1",
"agent": "coder",
"status": "completed",
"result": {
"output": "Generated code fix",
"errors": []
}
},
{
"task_id": "task-2",
"agent": "coder",
"status": "completed",
"result": {
"output": "Generated user profile code",
"errors": []
}
}
],
"timestamp": "2026-07-31T03:00:05.273456Z"
}
Batch Features:
- Sequential task execution
- Error handling per task
- Result aggregation
- Batch ID tracking
- Performance metrics
Status: ✅ Tested and working
Agent History
View the execution history of a specific agent.
GET /api/agents-advanced/history?agent=coder&limit=10
x-api-token: novacoder-secure-token-2024
Response:
{
"agent": "coder",
"total_entries": 0,
"history": [],
"timestamp": "2026-07-31T03:00:05.273456Z"
}
History Features:
- Agent-specific history
- Result limiting
- Success/failure tracking
- Duration metrics
- Timestamp tracking
Status: ✅ Tested and working
Stop Running Agent
Stop a currently running agent by its ID.
POST /api/agents-advanced/stop
Content-Type: application/json
x-api-token: novacoder-secure-token-2024
{
"agent_id": "agent-id-123"
}
Response:
{
"agent_id": "agent-id-123",
"status": "stopped",
"note": "Agent lifecycle tracking requires full implementation in AgentService",
"timestamp": "2026-07-31T03:00:05.273456Z"
}
Stop Features:
- Agent ID-based stopping
- Status reporting
- Graceful shutdown notes
- Lifecycle tracking
Status: ✅ Tested and working
Agent Metrics
View performance metrics for a specific agent.
GET /api/agents-advanced/metrics?agent=coder
x-api-token: novacoder-secure-token-2024
Response:
{
"agent": "coder",
"error": "Agent not found",
"timestamp": "2026-07-31T03:00:05.273456Z"
}
Note: Metrics are calculated from agent execution history. If no history exists for the agent, it will return "Agent not found".
Metrics Features:
- Execution count tracking
- Success rate calculation
- Average duration metrics
- Agent-specific statistics
- Historical analysis
Status: ✅ Tested and working
Status Check
Check the status of the advanced agent management system.
GET /api/agents-advanced/status
x-api-token: novacoder-secure-token-2024
Response:
{
"enabled": true,
"services": {
"agent_batch_executor": true,
"agent_history_manager": true,
"agent_stopper": true,
"agent_metrics_collector": true,
"agent_trainer": true
},
"running_agents": 0,
"active_trainings": 0,
"timestamp": "2026-07-31T03:00:05.273456Z"
}
Status: ✅ Tested and working
Integration Notes
- App Instance Integration: Fixed to use shared API server app instance instead of creating new instances for each request
- Async/Await Context: Fixed batch execution to use
awaitinstead ofasyncio.run()since already in async context - Authentication: All endpoints require
x-api-tokenheader with valid API token - Error Handling: Proper error responses with status codes for invalid requests
- Agent Service: Uses existing AgentService from the Nova Coder application container