Overview
The Agent Scheduler is the core intelligence component of RepoMaster that analyzes user input, creates structured task plans, and selects appropriate tools from the available toolkit. It operates in multiple distinct modes to fulfill user requirements through intelligent agent orchestration.System Messages
The scheduler agent is configured with a comprehensive system message that defines its behavior and capabilities.Scheduler Agent System Message
The scheduler operates with four distinct modes:- Web Search Mode: Search the internet for real-time information, current events, or general knowledge
- Repository Mode: Search and use GitHub repositories or local repositories through hierarchical repository analysis
- General Code Assistant Mode: Provide general programming assistance without specific repositories
Mode Selection Strategy
Working Process
1. Task Analysis and Initial Assessment
Upon receiving user input, the scheduler:- Thoroughly analyzes the requirements
- Step 1 - Web Search Assessment: Determines if task requires real-time data or external knowledge
- Step 2 - Plan Creation: Creates structured plan prioritizing repository-first approach when applicable
2. Tool Selection and Execution
The scheduler executes the plan by selecting one appropriate tool at a time:Repository Mode (GitHub/Local)
- Use
run_repository_agenttool with repository URL or local path - Tool automatically detects repository type
General Code Assistant Mode
- Use
run_general_code_assistanttool for programming guidance
Web Search Mode
- Use
web_searchtool for real-time information or general knowledge - Can be used standalone or as part of solving larger tasks
Repository-First Approach
- Repository Search: Use
github_repo_searchto find relevant repositories - Sequential Execution: Select most promising repository and execute task
- Result Evaluation and Switching:
- Evaluate if result satisfies requirements
- If current repository fails, try next best repository
- Continue until task completed or all viable options exhausted
3. Sequential Execution and Fallback
Subsequent tools are selected based on:- Outcomes of previously executed tools
- Current state of the plan
- Capabilities of available tools
User Proxy System Message
Agent Initialization
Scheduler Agent
The scheduler agent is initialized as anExtendedAssistantAgent:
Agent name identifier:
"scheduler_agent"Comprehensive system message defining agent behavior and mode selection strategy
Function to detect termination messages (checks if content ends with “TERMINATE”)
Language model configuration
User Proxy Agent
The user proxy agent is initialized as anExtendedUserProxyAgent:
Agent name identifier:
"user_proxy"System message defining execution proxy behavior
Language model configuration
Function to detect termination messages
Set to
"NEVER" for fully autonomous operationMaximum number of consecutive automatic replies (default: 10)
Configuration for code execution environment
Tool Registration
The scheduler has access to four primary tools:Available Tools
- web_search: Search the internet for real-time information
- run_repository_agent: Execute tasks using GitHub or local repositories
- run_general_code_assistant: Provide general programming assistance
- github_repo_search: Search for relevant GitHub repositories
Conversation Flow
Initiating a Chat
Initial task message from the user
Maximum number of conversation turns (default: 12)
Method for generating conversation summary:
"reflection_with_llm" or "last_msg"Arguments for summary generation, including custom summary prompt
Extracting Final Answer
Usage Examples
Basic Task Execution
Repository Mode Example
- Analyze the task
- Search for relevant PDF processing repositories
- Select the best repository
- Execute the conversion task
- Return the result
Direct Tool Access
While the scheduler typically orchestrates tool usage, tools can be called directly:Turn-taking and De-duplication
The scheduler implements intelligent turn-taking to avoid repetition:- Before sending any message, compares it with previous two messages
- If response would substantially repeat previous content, skips it
- If task has already been fully answered, replies with “TERMINATE”
- Ensures efficient conversation flow and prevents circular discussions
Important Notes
- Always validates that local paths exist before using repository mode
- In general code assistant mode, creates practical, executable examples
- If a tool is successfully called, answers based on tool’s results and overall plan
- If no available tool can solve the task, generates answer based on knowledge
- When task is completed successfully, replies with “TERMINATE”