Spaces:
Sleeping
Sleeping
File size: 3,297 Bytes
180d1d3 930b528 180d1d3 ba4292e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | # Architecture
## System Overview
```
βββββββββββββββ βββββββββββββββ ββββββββββββββββββββ
β Gradio UI ββββββΆβ FastAPI ββββββΆβ Agent Layer β
β Port 7860 β β Port 8000 β β β
βββββββββββββββ βββββββββββββββ β ββββββββββββββ β
β β Repo Agent β β
β ββββββββββββββ€ β
β β Bug Agent β β
β ββββββββββββββ€ β
β β Test Agent β β
β ββββββββββββββ€ β
β β Review β β
β ββββββββββββββ€ β
β β Report β β
β ββββββββββββββ β
ββββββββββββββββββββ
```
## Agent Flow
1. User submits GitHub URL via Gradio
2. Gradio sends POST request to FastAPI
3. FastAPI clones repository locally (shallow clone, depth=1)
4. `repo_analysis_agent` runs first to build repository metadata
5. `bug_detection_agent`, `test_generation_agent`, `code_review_agent` run **in parallel** via `asyncio.gather`
6. `report_generator_agent` aggregates all outputs into a final report
7. Cloned repository is deleted from disk
8. Results displayed in Gradio tabs
## Data Flow
```
RepositoryRequest
β
βΌ
clone_repository()
β
βΌ
RepositoryMetadata βββΆ IssueReport βββΆ GeneratedTests βββΆ ReviewSuggestions
β β β β
ββββββββββββββββββββββ΄ββββββββββββββββββ΄βββββββββββββββββββββ
β
βΌ
EngineeringReport
```
## LLM Integration
All agents use OpenRouter API with open source models.
Default model: `meta-llama/llama-3.3-70b-instruct`
Alternative models:
- `mistralai/mistral-7b-instruct`
- `deepseek/deepseek-chat`
- `google/gemma-3-27b-it`
## Task queue design
Jobs are routed to one of two Celery queues backed by Redis:
| Queue | Threshold | Expected duration |
|---|---|---|
| `high` | repos < 50 MB | < 60 s |
| `low` | repos β₯ 50 MB | 1β5 min |
Workers consume `high` before `low`, so a flood of large-repo jobs cannot
starve small fast ones. Both queues are durable β a Redis restart does not
lose in-flight tasks because `task_acks_late=True` means a task is only
acknowledged after it completes, not on receipt.
Retry policy: up to 2 retries with 60 s / 120 s exponential backoff. |