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.
async def web_search( self, query: Annotated[str, "Query for general web search"]) -> str: """Perform general web search for real-time information""" return await self.repo_searcher.deep_search(query)
Repository Type Detection (agent_scheduler.py:206-229):
# Automatically detect repository typeif repo_type is None: if repository.startswith(('http://', 'https://')) and 'github.com' in repository: repo_type = 'github' elif os.path.exists(repository): repo_type = 'local' else: # Try to determine if it's a GitHub URL format if repository.startswith(('http://', 'https://')) or repository.count('/') >= 1: repo_type = 'github' else: raise ValueError(f"Unable to determine repository type: {repository}")
Understanding Guide: ['Read README.md to understand basic functionality']#### File Paths- Input file paths and descriptions:{input_data}- Output file directory: Results must be saved in the {output_dir_path} directory.#### Additional Notes**Core Objective**: Quickly understand and analyze the code repository, generate and execute necessary code to complete user-specified tasks."""
Placeholder Replacement (git_task.py:210-222):
placeholders = { '{repo_path}': target_repo_path, '{input_data}': target_input_data, '{output_dir_path}': target_output_path, '{task_description}': task_info.get('task_description', '')}for placeholder, value in placeholders.items(): task_desc = task_desc.replace(placeholder, value)
if repo_type == 'local': source_repo_path = repo_info['path'] repo_name = Path(source_repo_path).name target_repo_path = f"{work_dir}/{repo_name}" if not os.path.exists(target_repo_path): os.system(f"cp -a {source_repo_path} {target_repo_path}")
1. Repository Search: Use github_repo_search to find relevant repositories2. Sequential Execution: Select most promising repository3. Result Evaluation: Critically evaluate if result satisfies requirements4. Switching: If failed, select next best repository and retry5. Continue: Until success or all options exhausted
Execution Logic:
# 1. Search for repositoriesrepo_list = github_repo_search(task)# 2. Try each repository sequentiallyfor repo in repo_list: result = run_repository_agent( task_description=task, repository=repo['repo_url'] ) # 3. Evaluate result if result_satisfies_requirements(result): return result # 4. Try next repository continue
From scheduler system message (agent_scheduler.py:56-60):
3. Sequential Execution and Fallback: - If one approach doesn't yield a solution, consider trying an alternative mode (e.g., switching to General Code Assistant Mode) - Be persistent in finding a solution - If one repository doesn't work, try another