Most AI coding assistants sit in your IDE, whispering auto-completions as you type. Sweep takes a fundamentally different path: it acts as an asynchronous junior engineer living directly inside GitHub. You post an issue; Sweep reads the repository, generates the patch, runs checks, and hands you an open Pull Request.
At 365Finds, we look at developer automation through a skeptical lens. A generative model writing code without execution feedback is an invitation to production incidents. Sweep’s workflow succeeds or fails based on one specific architectural boundary: how it grounds natural language tickets into real repository ASTs, and whether its dual-tier testing loop actually catches regressions before a human reviewer ever looks at the diff.
Here is the exact technical pipeline Sweep uses to convert an issue description into a functional pull request, and how automated testing closes the feedback loop.
1. The Trigger: Webhook Ingestion and Intent Parsing
The workflow starts when an issue is created or updated on GitHub. Sweep does not poll repositories; it responds to GitHub App webhooks.
flowchart LR
A["GitHub Issue Created<br/>(e.g., 'Sweep: Fix timeout')"] --> B["Sweep Backend Webhook"]
B --> C["Intent Parsing & Task Scoping"]
C --> D["Context Retrieval (AST + Lexical)"]
- Invocation Triggers: Sweep triggers either when an issue title or body begins with
Sweep:or when a specific label (such asSweep) is applied to the ticket. It also responds to comments on existing pull requests. - Payload Ingestion: GitHub delivers an
issues.openedorissue_comment.createdwebhook to Sweep’s backend. Sweep parses the title, description, code snippets, issue labels, and repository metadata. - Scoping the Request: Before touching files, the engine determines whether the task is an actionable bug fix, a small feature, refactoring, or documentation work. If an issue is fundamentally conversational or missing context, the initial plan flags ambiguities rather than guessing blindly.
2. Codebase Retrieval: Hybrid Search and AST Parsing
Language models have context windows, but production repositories span hundreds of thousands of lines. Throwing entire repositories into prompt context is both impossible and financially prohibitive. Sweep solves this with a hybrid retrieval pipeline.
AST-Guided Chunking
Instead of splitting code files into fixed token counts (which splits functions in half and destroys semantics), Sweep parses code into Abstract Syntax Trees (ASTs). Code chunking happens along logical boundaries:
- Classes and module headers
- Function signatures and docstrings
- Import trees and module dependencies
Multi-Vector and Lexical Retrieval
Sweep indexes the repository using two complementary engines:
- Lexical Search (BM25 / Keyword): Accurately locates exact symbol names, specific error strings, configuration flags, or variable names mentioned in the issue.
- Vector Embeddings (Dense Semantic Search): Identifies conceptually related code modules even when the issue author used different terminology than the codebase.
By computing file dependency graphs alongside search scores, Sweep gathers the target file, its imported utilities, and existing unit tests into a focused context package.
3. Planning and Multi-File Code Synthesis
Once the context package is assembled, Sweep invokes an LLM to generate an execution plan.
Sweep breaks the job into a structured schema:
- Target Files: Which files must be modified, created, or deleted.
- Proposed Diffs: Targeted edits rather than rewriting complete 2,000-line files from scratch, minimizing merge conflicts and token waste.
- Test Plan: Identifying existing test suites and outlining new test cases required to verify the bug fix or feature.
Sweep respects repository-level guidelines defined in .sweep/sweep.yaml or sweep.yaml. If your team enforces rules such as "use custom logging wrapper" or "all API handlers require pydantic validation," Sweep injects these system prompts directly into the generation step.
4. The Two-Tier Automated Testing Loop
Writing code is only half the battle. What makes Sweep practical—and why 365Finds considers its design superior to isolated code generation scripts—is its execution validation loop. Sweep verifies code across two distinct phases.
flowchart TD
A["Synthesize Code Changes"] --> B["Tier 1: Sweep Sandbox"]
B --> C{"Sandbox Checks Pass?"}
C -- "Fails" --> D["Inject Compiler/Linter Errors into Context"]
D --> A
C -- "Passes" --> E["Push Branch & Open GitHub PR"]
E --> F["Tier 2: Native GitHub Actions (CI)"]
F --> G{"CI Checks Green?"}
G -- "Fails & gha_enabled=true" --> H["Parse CI Failure Logs"]
H --> A
G -- "Passes" --> I["Ready for Human Code Review"]
Tier 1: The Sweep Isolated Sandbox
Before any commit is pushed to your remote repository, Sweep runs code through an isolated sandbox container configured via sweep.yaml:
# Example sweep.yaml configuration
branch: "main"
gha_enabled: true
rules:
- "Always add type annotations to new public functions."
- "Write unit tests for new API routes."
sandbox:
install:
- poetry install
check:
- poetry run pytest
- poetry run ruff check {file_path}
- Instant Static Validation: The sandbox executes linters, formatters, and type checkers (such as Ruff, ESLint, Pylint, or MyPy).
- Local Test Execution: If lightweight unit test suites are configured under
check, Sweep runs them immediately. - Fast Failure Self-Correction: When a command exits with a non-zero code, Sweep intercepts
stderr, treats the compilation or assertion error as corrective context, and patches the file again before publishing the branch.
Tier 2: GitHub Actions Self-Healing
If the repository has gha_enabled: true in sweep.yaml, Sweep monitors the GitHub Actions workflows triggered by its pull request commit.
- Sweep pushes a dedicated branch (e.g.,
sweep/fix-timeout-issue-42) and opens the PR. - GitHub runs your full CI pipeline: integration tests, database migrations, Docker builds, and matrix environments.
- If a CI workflow fails, Sweep catches the webhook, pulls the failed step’s log trace, isolates the traceback, and commits a follow-up fix directly to the PR branch.
5. Sweep vs. Traditional IDE Copilots
To understand whether Sweep fits your team, 365Finds compares its architectural model against conventional IDE autocomplete tools:
| Dimension | Interactive IDE Assistants | Sweep Asynchronous Agent |
|---|---|---|
| Primary Interface | Local Editor (VS Code / JetBrains) | GitHub Issues & Pull Requests |
| Execution Trigger | Real-time keystroke / User prompt | Webhook via Issue title or label |
| Context Scope | Open tabs, active file, local workspace | Full-repo AST index, lexical search, dependency graph |
| Testing Mechanism | Manual execution by developer | Automated: Sandbox execution and GitHub Actions self-healing |
| Human Role | Line-by-line reviewer while typing | Final PR reviewer before merge |
| Best Used For | Real-time coding, interactive exploration | Backlog bugs, refactoring, boilerplate tests, small features |
6. The 365Finds Verdict: Where It Works, Where It Breaks
At 365Finds, we appreciate tools that refuse to pretend AI is infallible. By building the sandbox and GitHub Actions feedback directly into the loop, Sweep respects the reality of software engineering: first drafts rarely compile cleanly.
However, Sweep is not a replacement for senior engineers:
- The "Garbage In, Garbage Out" Trap: If an issue simply states "fix user login," Sweep will guess. It needs precise problem descriptions, stack traces, or expected input/output behaviors.
- CI Budget Consumption: An agent continuously triggering heavy CI suites can rapidly burn through your GitHub Actions runner minutes if a test is flaky or fundamentally untestable without external secrets.
- Deep Architectural Boundaries: Multi-repository dependencies or migrations spanning third-party infrastructure remain outside its blast radius.
Where Sweep shines without reservation is the unglamorous backlog: converting legacy endpoints to new typing standards, adding regression unit tests for closed bugs, updating dependencies, and handling self-contained bug tickets while your team sleeps.