mirror of
https://github.com/jeffusion/gitea-ai-assistant.git
synced 2026-03-27 10:05:50 +00:00
33b3d9c9ab4a163927abc42515d3223a17e6b0af
# 1.0.0 (2026-03-03) ### Bug Fixes * remove trailing comma in package.json ([c1d3077](c1d3077654)) * 修复E2E测试基础设施 ([e91ebdc](e91ebdc974)) ### Features * **admin:** 添加后台管理界面和Webhook管理功能 ([3a0cb36](3a0cb36f02)) * **api:** add config management REST endpoints ([d375a4c](d375a4c82d)) * **config:** add runtime config manager with 3-layer priority ([d946423](d946423d45)) * **frontend:** add config management page with UI components ([f223e35](f223e35cbb)) * **frontend:** add react-router and refactor app routing ([0b5cbfd](0b5cbfd5ba)) * 增加pr提醒,支持飞书机器人消息通知 ([e9d4f67](e9d4f6776c)) * 添加Agent审查引擎核心类型和Schema定义 ([4c90bf0](4c90bf0b9c)) * 添加Agent审查相关配置项和依赖 ([611fcf3](611fcf39d5)) * 添加发布策略和文件审查存储 ([5ddd858](5ddd858785)) * 添加向量记忆和学习系统 ([956a84a](956a84acc1)) * 添加四个分类专家Agent定义 ([4b58f15](4b58f158fc)) * 添加多Agent审查代理(specialist/reflexion/judge/critic/debate) ([1d9ed3d](1d9ed3d969)) * 添加审查编排器和引擎入口 ([25d4f56](25d4f56bde)) * 添加工具注册表和代码搜索工具 ([6186210](6186210b4e)) * 添加沙箱执行和本地仓库管理器 ([d1e1e2f](d1e1e2f33c)) * 集成Agent审查引擎到应用入口和控制器 ([2ce2a5f](2ce2a5f6a6)) * 项目更名并调整接口 ([b8e5c5e](b8e5c5eb41))
Gitea AI Assistant
AI-powered code review assistant for Gitea. Automatically reviews Pull Requests and commits using OpenAI, providing intelligent code quality analysis with both summary comments and line-level feedback.
Features
- 🤖 AI Code Review - Automatic review of PRs and commits using OpenAI models
- 📝 Line-Level Comments - Precise feedback on specific code changes
- 🔄 Dual Review Engines - Legacy (simple) or Agent-based (multi-agent) review modes
- 🔔 Feishu Notifications - Integrated notification system for PR events
- 🎛️ Admin Dashboard - Web UI for managing repository webhooks and configuration
- 🔐 Secure Webhooks - HMAC-SHA256 signature verification
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Gitea Server │────▶│ Gitea Assistant │────▶│ OpenAI API │
│ (Webhooks) │ │ (Hono + Bun) │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ Admin Dashboard │
│ (React SPA) │
└──────────────────┘
Review Engines
| Engine | Description | Use Case |
|---|---|---|
legacy |
Single-pass AI review with summary + line comments | Simple, fast reviews |
agent |
Multi-agent orchestration with specialists, reflection, and debate | Deep, comprehensive analysis |
Quick Start
Prerequisites
- Bun >= 1.2.5
- Gitea instance with API access
- OpenAI API key
Installation
git clone https://github.com/user/gitea-ai-assistant.git
cd gitea-ai-assistant
bun install
cp .env.example .env
Configuration
Edit .env with your settings:
# Gitea
GITEA_API_URL=https://your-gitea-instance.com/api/v1
GITEA_ACCESS_TOKEN=your_gitea_token
# OpenAI
OPENAI_API_KEY=your_openai_key
OPENAI_MODEL=gpt-4o-mini
# Security
WEBHOOK_SECRET=your_webhook_secret # openssl rand -hex 32
# Admin Dashboard
ADMIN_PASSWORD=your_admin_password
See Configuration Reference for all options.
Running
bun run dev # Development mode
bun run start # Production mode
Setting Up Webhooks
Option 1: Admin Dashboard (Recommended)
- Access
http://your-server:3000 - Log in with
ADMIN_PASSWORD - Click "Enable" on repositories to auto-configure webhooks
Option 2: Manual Configuration
In Gitea repository settings, add a webhook:
- URL:
http://your-server:3000/webhook/gitea - Content Type:
application/json - Secret: Same as
WEBHOOK_SECRET - Events: "Pull Request" and "Status"
Configuration Reference
Core Settings
| Variable | Description | Default |
|---|---|---|
GITEA_API_URL |
Gitea API endpoint | Required |
GITEA_ACCESS_TOKEN |
Token for code review (read + comment permissions) | Required |
GITEA_ADMIN_TOKEN |
Token for webhook management (optional) | - |
OPENAI_BASE_URL |
OpenAI API base URL | https://api.openai.com/v1 |
OPENAI_API_KEY |
OpenAI API key | Required |
OPENAI_MODEL |
Model to use | gpt-4o-mini |
PORT |
Server port | 3000 |
WEBHOOK_SECRET |
Webhook signature secret | Required |
Custom Prompts
| Variable | Description |
|---|---|
CUSTOM_SUMMARY_PROMPT |
Override the default summary review prompt |
CUSTOM_LINE_COMMENT_PROMPT |
Override the default line comment prompt |
Admin Dashboard
| Variable | Description | Default |
|---|---|---|
ADMIN_PASSWORD |
Dashboard login password | password |
JWT_SECRET |
JWT signing secret | Auto-generated |
Feishu Integration
| Variable | Description |
|---|---|
FEISHU_WEBHOOK_URL |
Feishu bot webhook URL |
FEISHU_WEBHOOK_SECRET |
Feishu webhook secret (optional) |
Agent Review Engine
Enable with REVIEW_ENGINE=agent for advanced multi-agent reviews:
| Variable | Description | Default |
|---|---|---|
REVIEW_ENGINE |
Engine mode (legacy or agent) |
legacy |
REVIEW_WORKDIR |
Working directory for repo clones | /tmp/gitea-assistant |
REVIEW_MODEL_PLANNER |
Planner model | gpt-4o-mini |
REVIEW_MODEL_SPECIALIST |
Specialist model | gpt-4o-mini |
REVIEW_MODEL_JUDGE |
Judge model | gpt-4o-mini |
REVIEW_MAX_PARALLEL_RUNS |
Max concurrent tasks | 2 |
REVIEW_MAX_FILES_PER_RUN |
Max files per review | 200 |
REVIEW_AUTO_PUBLISH_MIN_CONFIDENCE |
Min confidence for auto-publish | 0.8 |
REVIEW_ENABLE_HUMAN_GATE |
Enable human approval | true |
Memory & Learning (Experimental)
| Variable | Description | Default |
|---|---|---|
QDRANT_URL |
Qdrant vector database URL | - |
ENABLE_MEMORY |
Enable memory system | false |
ENABLE_REFLECTION |
Enable self-critique | false |
ENABLE_DEBATE |
Enable multi-agent debate | false |
Deployment
Docker
docker build -t gitea-assistant .
docker run -d -p 3000:3000 --env-file .env gitea-assistant
Docker Compose
docker-compose up -d
License
MIT License
Description
Gitea功能增强助手,基于Bun和TypeScript开发,提供AI驱动的代码审查等增强功能。本工具通过Webhook与Gitea集成,自动对Pull Request和提交进行代码审查,并提供智能化的代码质量分析。
⚠️ ARCHIVED: Original GitHub repository no longer exists. Preserved as backup on 2026-03-27T15:06:50.991Z
Languages
TypeScript
96.3%
CSS
1.7%
Shell
1.4%
JavaScript
0.4%
Dockerfile
0.2%