Overview
RepoMaster’s task routing system automatically analyzes user requests and selects the optimal execution strategy. The scheduler agent acts as an intelligent orchestrator, choosing between web search, repository exploration, or general programming assistance.Routing Architecture
Mode Selection Strategy
The scheduler agent analyzes tasks using a prioritized decision process defined inagent_scheduler.py:19-71.
1. Web Search Priority
Trigger Conditions:- Questions requiring real-time data
- Current events or latest information
- External documentation lookup
- General knowledge queries
- “What is the stock price of APPLE?”
- “Latest Python 3.12 features”
- “How to use the new React hooks API?“
2. Repository Mode
Trigger Conditions:- User mentions local file paths or directories
- Specific repository URLs provided
- Task requires analyzing existing code
- Need for specialized tools/libraries
GitHub Repository Mode
GitHub Repository Mode
Process:
- Validate GitHub URL format
- Build repository configuration
- Initialize TaskManager with GitHub URL
- Clone repository to working directory
- Execute task with CodeExplorer
Local Repository Mode
Local Repository Mode
Process:
- Validate local path exists
- Build repository configuration
- Initialize TaskManager with local path
- Copy repository to working directory
- Execute task with CodeExplorer
3. General Code Assistant Mode
Trigger Conditions:- General programming questions
- Algorithm implementations
- Code examples without specific repository
- Debugging help
Task Initialization Flow
TaskManager Initialization
TheTaskManager class handles task environment setup (git_task.py:159-256).
Key Method: initialize_tasks(args) (git_task.py:236-256):
Task Prompt Generation
Template Structure (git_task.py:171-191):Environment Setup
TheDataProcessor class handles environment preparation (git_task.py:62-157).
Repository Setup
GitHub Repository (git_task.py:116-124):Input Data Handling
Data Copy Process (git_task.py:136-156):Input Data Format: Provide input data as JSON list:
Agent Execution Flow
Sequential Repository Search
Repository-First Approach (agent_scheduler.py:48-54):AgentRunner Execution
Main Execution Method (git_task.py:262-323):Path Management
ThePathManager class provides utilities for directory and ID generation (git_task.py:20-60).
Unique Path Generation
Task ID Generation (git_task.py:24-27):Work Task Path
coding/gitbench_0304_1423/ - Root task directoryWorkspace
workspace/ - Code execution environmentInput Dataset
input_dataset/ - User-provided input filesOutput Result
output_result/ - Task execution outputsRetry and Fallback Mechanisms
Automatic Retry
Retry Logic (git_task.py:310-312):- Initial retry count: 2
- Triggers: Missing output directory
- Action: Re-execute entire agent workflow
Mode Fallback
From scheduler system message (agent_scheduler.py:56-60):Task Tracing and Debugging
Conversation History Export
Trace File Generation (agent_code_explore.py:309-315):Result Extraction
Final Answer Extraction (agent_scheduler.py:394-414):Working Directory Structure
Best Practices
For Task Description
Be Specific
Be Specific
Provide clear, detailed task descriptions with:
- Exact requirements
- Expected output format
- Input data descriptions
- Success criteria
Include Context
Include Context
Mention:
- Repository URLs or paths
- Related documentation
- Dependencies or requirements
- Example inputs/outputs
For Repository Tasks
- Use absolute paths for local repositories
- Ensure GitHub URLs are accessible
- Provide input data descriptions
- Specify output directory requirements
For Performance
- Set appropriate
max_turns(default: 20) - Use retry count wisely (default: 2)
- Enable virtual environments for isolation
- Monitor working directory sizes
Next Steps
Repository Exploration
Learn about code analysis tools
Multi-Agent System
Understand agent collaboration