βββββββββββ ββββββββββββββββββ ββββββ βββββββ βββββββββ
βββββββββββ βββββββββββββββββββββββββ ββββββββββββββββββ
βββββββββββ ββ βββββββββ ββββββββββββββ βββ βββ βββ
ββββββββββββββββββββββββ βββββββ ββββββ βββ βββ βββ
βββββββββββββββββββββββββββββ ββββββββββββββββββββ βββ
ββββββββ ββββββββ βββββββββββ βββββββββββ βββββββ βββ
SWEPilot is an AI-powered software engineering automation system that transforms GitHub issues into tested, review-ready Pull Requests. It leverages mini-SWE-agent and an Azure-hosted language model to analyze issues, modify code, execute tests, and automate the Git workflow.
- Overview
- Problem Statement
- Key Features
- How It Works
- Architecture
- Technology Stack
- Project Status
- Getting Started
- Configuration
- Example Workflow
- Security Considerations
- Future Enhancements
- Contributing
- License
Software development teams spend considerable time investigating bugs, implementing repetitive fixes, running tests, and preparing Pull Requests. SWEPilot aims to automate this process through an autonomous AI coding workflow.
A developer creates a GitHub issue describing a bug or feature request. SWEPilot identifies eligible issues, launches a coding agent, and coordinates the complete workflow:
GitHub Issue β Code Analysis β AI-Generated Changes β Testing β Feature Branch β Pull Request
The system is designed to keep developers in control by generating Pull Requests for review rather than directly modifying the production branch.
Traditional issue-resolution workflows often require developers to:
- Understand the issue and reproduce the problem.
- Locate the relevant files in a large codebase.
- Implement and test a solution.
- Create a feature branch.
- Commit and push the changes.
- Prepare a Pull Request for review.
SWEPilot addresses these repetitive tasks by combining an AI coding agent with a deterministic orchestration layer and GitHub integration.
- Automate the transition from GitHub issues to code changes.
- Use an Azure-hosted AI model for software engineering tasks.
- Execute tests before proposing a Pull Request.
- Automate Git branch creation, commits, and pushes.
- Generate Pull Requests with useful summaries and validation results.
- Maintain human oversight through mandatory code review.
- AI-powered code modification: Uses mini-SWE-agent to analyze a repository and edit relevant files.
- Azure model integration: Runs the coding workflow using an Azure-deployed language model.
- Repository-aware execution: Allows the coding agent to inspect and work within a repository workspace.
- GitHub App integration: Receive issue events through secure webhooks.
- Issue-based triggering: Detect issues containing the
--agentmarker or a dedicated automation label. - Automated repository cloning: Clone the target repository into an isolated workspace.
- Feature branch management: Create a dedicated branch for each issue.
- Automated validation: Run tests and inspect the results before pushing changes.
- Automated Git operations: Commit and push generated changes to the feature branch.
- Pull Request generation: Create a PR using the GitHub REST API.
- PR reporting: Add change summaries, test results, and relevant issue references.
- Self-healing workflow: Optionally allow the coding agent to respond to failed tests.
- Execution monitoring: Track job status, failures, and agent activity.
βββββββββββββββββββββββββ
β GitHub Issue β
β --agent β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β GitHub Webhook β
β Event Verification β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β Orchestrator β
β Validate & Queue β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β Azure VM β
β Isolated Workspace β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β mini-SWE-agent β
β Analyze & Modify β
β Code β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β Test Execution β
β Validate Changes β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β Create Feature β
β Branch & Commit β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β Git Push β
β Push Branch to GitHubβ
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β GitHub REST API β
β Create Pull Requestβ
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β Human Code Review β
β Approve or Reject β
βββββββββββββββββββββββββ
- A developer creates a GitHub issue containing
--agentin its title or applies an automation label. - GitHub sends an event to the SWEPilot webhook endpoint.
- The orchestrator validates the event and creates a job.
- The worker clones the repository into a dedicated workspace.
- A feature branch is created from the selected base branch.
- mini-SWE-agent analyzes the issue and modifies the code using the Azure-hosted model.
- The worker executes the repository's configured tests and validation commands.
- If validation succeeds, the changes are committed and pushed to the feature branch.
- The orchestrator calls the GitHub REST API to create a Pull Request.
- The PR includes a summary of the changes, test results, and a reference to the original issue.
- A human reviews the generated changes before merging.
SWEPilot separates AI-powered coding from deterministic workflow management.
ββββββββββββββββββββββββ
β GitHub β
β Issues / PRs / Repo β
ββββββββββββ¬ββββββββββββ
β
HTTPS Webhook
β
βΌ
ββββββββββββββββββββββββ
β SWEPilot Backend β
β Webhook + API Layer β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Orchestrator β
β Workflow Controller β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Azure VM β
β Worker Process β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Isolated Workspace β
β Clone + Git Branch β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β mini-SWE-agent β
β AI Coding β
ββββββββββββ¬ββββββββββββ
β
Azure-hosted LLM
β
βΌ
ββββββββββββββββββββββββ
β Tests & Validation β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Git Operations β
β Commit + Push Branchβ
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β GitHub REST API β
β Create Pull PR β
ββββββββββββββββββββββββ
| Component | Responsibility |
|---|---|
| GitHub App | Receives issue events and authenticates repository operations |
| Webhook Handler | Validates incoming GitHub events and identifies eligible issues |
| Orchestrator | Controls the job lifecycle and coordinates each workflow stage |
| Worker | Manages the repository workspace and executes the coding workflow |
| mini-SWE-agent | Analyzes issues, edits files, and runs shell commands |
| Azure-hosted Model | Provides the language-model intelligence for coding tasks |
| Test Runner | Executes project-specific tests and validation commands |
| Git Integration | Creates branches, commits changes, and pushes code |
| GitHub REST API | Creates Pull Requests and updates issue information |
| Technology | Purpose |
|---|---|
| Python | Agent execution and workflow orchestration |
| mini-SWE-agent | AI software engineering and code modification |
| Azure AI Foundry | Hosting and managing the deployed language model |
| Azure Virtual Machine | Running the agent worker and orchestration services |
| GitHub Apps | Secure repository and webhook integration |
| GitHub REST API | Branch, commit, and Pull Request operations |
| Git | Version control and remote branch management |
| Docker | Optional isolation for repository execution |
| FastAPI | Optional webhook and backend API framework |
| Azure Service Bus | Optional queue for asynchronous jobs |
| Azure Monitor | Optional logging and monitoring |
- mini-SWE-agent is operational.
- The agent successfully receives coding tasks.
- The agent edits files in the target repository.
- The agent uses an Azure-deployed language model.
- Working webhook endpoint.
- Issue-trigger detection.
- Automated repository cloning.
- Commit and push workflow.
- Feature branch creation.
- GitHub REST API Pull Request creation.
- Automated test execution.
- End-to-end issue-to-PR integration.
Before running SWEPilot, ensure you have:
- Python 3.10 or newer.
- Git installed and available in the system PATH.
- Access to an Azure-deployed language model.
- A GitHub repository for testing.
- Appropriate GitHub permissions for repository operations.
- An Azure VM or equivalent execution environment.
git clone https://github.com/Hrick-08/SWEPilot.git
cd SWEPilotpython -m venv .venvActivate it on Windows:
.venv\Scripts\Activate.ps1Activate it on Linux or macOS:
source .venv/bin/activatepip install -r requirements.txtDependency installation instructions will be updated as the SWEPilot orchestration and GitHub integration modules are added.
Create a local .env file based on the required configuration.
Example:
AZURE_FOUNDRY_ENDPOINT=<your-azure-openai-endpoint>
AZURE_FOUNDRY_DEPLOYMENT=<your-azure-openai-deployment-name>
AZURE_FOUNDRY_API_KEY=<your-azure-openai-api-key>
# GitHub tokens are collected during registration and stored encrypted in the database.
# Optional legacy fallback for direct workflow calls.
# REPO_NAME=<github-username>/<repo-name>Do not commit API keys, GitHub private keys, or webhook secrets to version control.
uvicorn main:app --reloadSWEPilot will support configuration for the following workflow parameters:
| Setting | Description |
|---|---|
| Issue trigger | --agent marker or automation label |
| Base branch | Branch against which the PR is opened |
| Agent branch prefix | Prefix for generated branches, such as ai-agent/ |
| Test command | Project-specific test command |
| Lint command | Optional linting command |
| Maximum retries | Maximum number of agent repair attempts |
| Workspace directory | Location for temporary repository workspaces |
| PR title template | Format of generated PR titles |
| PR body template | Format of generated PR descriptions |
| Allowed repositories | Repositories eligible for automation |
A developer creates the following issue:
Title: Fix invalid login validation --agent
Description:
The login endpoint accepts invalid email formats.
Add proper validation and include tests for invalid inputs.
SWEPilot processes the issue and creates a branch:
ai-agent/issue-42-login-validation
After the agent modifies the code and tests pass, the worker executes:
git add .
git commit -m "Fix login validation for issue #42"
git push origin ai-agent/issue-42-login-validationThe orchestrator then calls the GitHub API:
POST /repos/{owner}/{repo}/pullsWith a request body similar to:
{
"title": "AI fix: login validation",
"head": "ai-agent/issue-42-login-validation",
"base": "main",
"body": "Generated by SWEPilot.\n\nCloses #42"
}The resulting Pull Request is submitted for human review.
SWEPilot executes AI-generated commands and repository code. Security is therefore a critical part of the system.
- Verify GitHub webhook signatures.
- Use GitHub App installation tokens instead of long-lived personal access tokens where possible.
- Restrict repository permissions to the minimum required.
- Never allow direct pushes to protected production branches.
- Execute untrusted code inside isolated environments.
- Store secrets in environment variables or a secure secret manager.
- Prevent concurrent jobs from modifying the same workspace.
- Enforce timeouts and resource limits on agent and test execution.
- Validate repository and branch information received from webhook events.
- Require human review before merging Pull Requests.
- Avoid exposing secrets to the AI agent or repository test processes.
- AI-powered code review before PR creation.
- Static analysis and security scanning.
- Test coverage reporting.
- Regression detection.
- Analyze failed test logs.
- Automatically retry failed tasks.
- Allow limited repair iterations.
- Update the existing PR with additional fixes.
This project is currently under development. Add the appropriate license information when the repository's licensing decision has been finalized.
- mini-SWE-agent β AI software engineering agent used as the coding engine.
- Azure AI Foundry β Azure platform used to host and manage the language model.
- GitHub REST API β Repository and Pull Request automation.
SWEPilot
From GitHub issues to AI-generated Pull Requests.