Spaces:
Running
Running
| # 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. |