Commit Graph

58 Commits

Author SHA1 Message Date
jeffusion
c45cb34a35 feat(ui): add LLM provider management frontend
Add complete Web UI for LLM provider configuration: provider list with
enable/disable toggles, add/edit dialog, connection testing with result
display, role assignment cards, and model combobox with API/recommended/custom
tags. All labels in Chinese. Add description prop to SelectItem for
Radix Select rendering fix. Register route and nav link.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
984cf734fe refactor(config): remove LLM settings from config layer
Strip OpenAI-specific settings (apiKey, baseUrl, model) and per-role model
overrides from config schema — these are now managed through the database
via the LLM provider UI. Simplify config-manager and its tests accordingly.
Keep only runtime settings (port, webhookSecret, etc.) in env/config.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
0bb6cf7849 refactor(review): migrate review agents from direct OpenAI to LLMGateway
Replace all direct OpenAI client usage in review agents, orchestrator,
learning system, and AI review service with the new LLMGateway abstraction.
Agents now call gateway.chatForRole() instead of openai.chat.completions.create(),
enabling multi-provider support across all review workflows. Add getAll()
method to ToolRegistry for provider capability checking.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
c6c8e20683 feat(llm): add LLM config REST API controller
Add REST endpoints under /admin/api/llm/ for provider CRUD, API key
management, role assignments, connection testing, and model listing.
Register routes in index.ts with JWT authentication middleware. Initialize
master key and database on server startup.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
21fef999fb feat(db): add SQLite database layer with encrypted secret storage
Add bun:sqlite-based database with automatic migration system. Includes
repositories for LLM providers (CRUD), model-role assignments, encrypted
API key secrets (AES-256-GCM via master.key), and system settings.
Single-file DB at data/assistant.db.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
c9a2db3df2 feat(llm): add pluggable multi-provider LLM architecture
Introduce provider-agnostic LLM gateway supporting 4 provider types:
OpenAI Compatible, OpenAI Responses API, Anthropic Messages API, and
Google Gemini API. Each provider normalizes to a unified LLMChatResponse
format with tool call support. Includes AES-256-GCM encrypted secret
management for API keys and a tool-converter for cross-provider tool
format translation.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
f0d981ad00 chore: update .gitignore and add bunfig.toml for test isolation
Exclude runtime data (data/), SQLite WAL files, frontend lock file, and
build artifacts. Add bunfig.toml to scope bun test to src/ only,
preventing it from picking up frontend vitest test files.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
afd568588d feat(config): add global prompt setting injected into all LLM calls
Add GLOBAL_PROMPT config field that appends user-defined instructions to
every LLM system message across all 9 call sites (legacy engine, agent
specialist, reflexion, critic, and debate orchestrator).

Configured via admin dashboard (auto-rendered from CONFIG_FIELDS metadata)
or GLOBAL_PROMPT env var. Example use: "请始终使用中文回复".

Changes:
- Add GLOBAL_PROMPT to Zod schema, AppConfig interface, and buildConfig
- Add CONFIG_FIELDS metadata (group: openai, type: text)
- Add getEffectiveValue switch case
- Add withGlobalPrompt() helper in src/utils/global-prompt.ts
- Inject into all LLM call sites via withGlobalPrompt wrapper

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
98e5048f2c fix(k8s): use writable emptyDir volume for config overrides
ConfigMap volumes are read-only in K8s, causing EROFS when saving config.
Replace ConfigMap-mounted config-overrides.json with a writable emptyDir
at /app/data/ and set CONFIG_OVERRIDES_PATH accordingly. The app handles
missing override files gracefully (starts with empty overrides).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
12425d147f fix(config): silently skip readonly fields on save instead of rejecting
Frontend sends entire form state including readonly fields (PORT,
WEBHOOK_SECRET, JWT_SECRET). Previously the backend rejected the whole
request. Now readonly fields are silently skipped.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
3f2817d6c3 fix(config): make persistOverrides resilient to read-only filesystems
Atomic rename (temp→target) fails on K8s volumes with EBUSY/EXDEV/EROFS.
Fall back to direct writeFile when rename fails, with best-effort
cleanup of orphaned temp files.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
2587576514 fix(agent): improve specialist agent JSON resilience and finding schema
- Add complete finding JSON schema (all required fields) to both legacy
  and ReAct system prompts to prevent malformed responses
- Change JSON parse error handling from break (abandon review) to
  injecting a guidance message that prompts the model to return valid JSON
- Add global prompt injection support via withGlobalPrompt helper

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
f410373f7b fix(agent): fix rg args ordering in function reference search tool
The --type-add and --type options were placed after the path argument,
causing ripgrep to treat them as additional paths rather than flags.
Moved option flags before the -e pattern and path arguments.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
ba2663552d fix(docker): add git, ca-certificates, and ripgrep to production image
Agent mode requires git for mirror cloning and rg for code search.
Both were missing from oven/bun:1-slim causing command failures (exit code -1).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
f3ba9de06f fix: remove isDev branches that caused production to use mock test data
Remove all isDev logic from review controller and config manager.
The isDev check treated missing NODE_ENV as development, causing
production to use a hardcoded fake commit SHA and skip real reviews.
Config validation now always fails fast on invalid configuration.
2026-03-24 12:30:13 +08:00
jeffusion
d84a0ed956 fix: make FEISHU_WEBHOOK_URL optional to prevent startup crash
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
2026-03-24 12:30:13 +08:00
jeffusion
dd147a24b4 chore(k8s): add Kubernetes deployment manifests 2026-03-24 12:30:13 +08:00
jeffusion
010582d702 chore(docker): add Qdrant service to docker-compose
- Add Qdrant vector database service with persistent storage
- Add health check and depends_on for service ordering
- Expose ports 6333 (HTTP) and 6334 (gRPC)
2026-03-03 19:02:31 +08:00
semantic-release-bot
33b3d9c9ab chore(release): 1.0.0 [skip ci]
# 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))
v1.0.0
2026-03-03 10:49:09 +00:00
jeffusion
c1d3077654 fix: remove trailing comma in package.json
Fixes semantic-release JSON parse error at position 1410.
2026-03-03 18:41:47 +08:00
jeffusion
c0fe893997 ci: rewrite CI/CD with semantic-release and GHCR Docker push
- Rewrite release.yml: semantic-release for auto-versioning + Docker
  image build and push to GitHub Container Registry (ghcr.io)
- Rewrite ci.yml: remove continue-on-error on lint
- Add .releaserc.json with changelog and git plugins
- Add semantic-release dependencies to package.json
- Fix Dockerfile: remove --frozen-lockfile from production install
- Update .dockerignore with comprehensive exclusions
- Update docker-compose.yml to pull from GHCR by default
- Remove obsolete pnpm packageManager field
- Remove obsolete kubernetes.yaml from .gitignore
2026-03-03 18:33:55 +08:00
路遥知码力
7d492ce775 Merge pull request #4 from jeffusion/agent-review-engine
Agent review engine
2026-03-03 17:31:16 +08:00
jeffusion
318e6d3688 build: replace tslint with Biome for code quality
- Add @biomejs/biome as dev dependency
- Remove deprecated tslint dependency
- Add biome.json with project-specific rules
- Update lint script to use Biome
- Apply Biome auto-fixes across codebase
2026-03-03 17:03:23 +08:00
jeffusion
6f389fc1a9 chore: remove obsolete files
- Remove check-engine.js (debug script)
- Remove kubernetes.yaml.template and Makefile (internal deployment)
- Remove auto-ver.sh (only used by Makefile)
- Remove test-webhook.json (manual test fixture)
- Remove tslint.json (deprecated, replaced by Biome)
- Remove frontend/README.md (Vite template boilerplate)
2026-03-03 17:03:14 +08:00
jeffusion
45e9b1f346 docs: rewrite README following open source standards with i18n
- Create English README.md as primary documentation
- Create Chinese docs/README.zh-CN.md with language link
- Focus on core functionality: features, quick start, configuration, deployment
- Remove CI badge, GitHub Actions, Contributing, Acknowledgments sections
- Remove verbose API Reference and Development sections
- Condense configuration examples for clarity
- Delete obsolete docs/ADMIN_UI_DESIGN.md
2026-03-03 16:49:19 +08:00
jeffusion
99bf4aff5e chore: add config-overrides.json to ignore files and docker volume
- Add config-overrides.json to .gitignore (user-specific runtime config)
- Add config-overrides.json to .dockerignore (not needed in image)
- Mount config-overrides.json as volume in docker-compose.yml

This enables persistent configuration overrides in containerized
deployments without rebuilding the image.
2026-03-03 16:33:34 +08:00
jeffusion
3cb53db8f0 chore: add concurrent dev script for backend and frontend
- Add concurrently package for parallel process execution
- Split dev script into dev:backend and dev:frontend
- Use concurrently to run both with colored, labeled output

This enables single-command development with 'bun run dev' that starts
both the backend server (with hot reload) and frontend dev server.
2026-03-03 16:33:18 +08:00
jeffusion
ee1d8f70f7 style(frontend): redesign UI with dark tech aesthetic
Complete visual overhaul with cyberpunk-inspired dark theme:
- New color palette: teal primary (#14b8a6), zinc grays
- Glass panel effects with backdrop blur
- Grid pattern backgrounds
- Glow effects on interactive elements

Component updates:
- LoginPage: Terminal-style login with animated effects
- DashboardPage: Collapsible sidebar with active indicators
- DataTable: Glass panel styling with hover states
- RepositoryManager: Tech-styled search and pagination
- WebhookToggleButton: Glow effect on enable action

CSS additions:
- Inter + JetBrains Mono fonts
- Custom utilities: glass-panel, tech-glow, bg-grid-pattern
- Updated CSS variables for dark mode
2026-03-03 16:32:59 +08:00
jeffusion
0b5cbfd5ba feat(frontend): add react-router and refactor app routing
Migrate to react-router-dom for SPA routing:
- Add BrowserRouter with nested routes
- Implement AuthGuard component for protected routes
- Add collapsible sidebar navigation
- Support /repos and /config routes

Changes:
- App.tsx: Route definitions with AuthGuard wrapper
- main.tsx: Force dark mode, improved retry logic
- DashboardPage.tsx: New layout with sidebar + Outlet
- vite.config.ts: Expose dev server on 0.0.0.0

Dependencies added:
- react-router-dom
- @radix-ui/react-select, switch, separator, tabs
2026-03-03 16:32:40 +08:00
jeffusion
f223e35cbb feat(frontend): add config management page with UI components
Add comprehensive configuration management UI:
- ConfigManager: Main page with grouped config display
- ConfigGroupCard: Expandable cards for each config group
- ConfigFieldInput: Smart input based on field type
  - Text, URL, password (masked), number, boolean, enum, textarea

UI Components added:
- Select, Switch, Tabs, Textarea, Separator from shadcn/ui

Features:
- Real-time field validation
- Source indicator (default/env/override)
- Save/reset functionality with toast notifications
- Responsive layout with collapsible groups
2026-03-03 16:32:21 +08:00
jeffusion
d375a4c82d feat(api): add config management REST endpoints
Add /admin/api/config routes for runtime configuration:
- GET /: Retrieve all config groups with field metadata and values
- PUT /: Validate and persist configuration overrides
- POST /reset: Reset specified keys to defaults (remove overrides)

Features:
- Sensitive field masking (passwords, secrets, API keys)
- Field validation (URL, enum, number range, boolean)
- Readonly field protection
- Grouped field organization with metadata
2026-03-03 16:32:01 +08:00
jeffusion
d946423d45 feat(config): add runtime config manager with 3-layer priority
Implement ConfigManager with three-layer configuration priority:
- Layer 1: Zod schema defaults
- Layer 2: Environment variables (process.env)
- Layer 3: JSON file overrides (config-overrides.json)

Features:
- Atomic file writes with temp+rename for reliability
- Synchronous load at startup for immediate availability
- Runtime hot-reload via async methods
- Source tracking (default/env/override) per config key
- Full Zod schema validation with type safety

Files added:
- src/config/config-manager.ts: Core manager implementation
- src/config/config-schema.ts: Field metadata and group definitions
- src/config/__tests__/: Unit tests for config manager
- typings/: TypeScript declaration files
2026-03-03 16:31:42 +08:00
accelerator
b4feb0a822 ci: 添加GitHub Actions CI/CD流水线
- CI: PR触发自动化测试(lint + type check + bun test)
- CD: push到main/tag触发Docker镜像构建并发布到GHCR
- 修复Dockerfile中bun.lockb→bun.lock引用
- 修复tsconfig.json排除测试文件避免dist中重复
- 修复file-review-store测试排序时间戳竞态
2026-03-01 14:47:22 +08:00
accelerator
e91ebdc974 fix: 修复E2E测试基础设施
- docker-compose.e2e.yml: 使用简化的Dockerfile.e2e替代主Dockerfile
- e2e/Dockerfile.e2e: 新增E2E专用镜像(跳过前端构建,安装git/ripgrep/curl)
- e2e/seed.sh: 修复mkdir -p src顺序(在写入文件之前创建目录)
- e2e/test.sh: 修复Test 5需要admin JWT认证访问review runs API
2026-03-01 14:14:13 +08:00
accelerator
5c0b4808ee test: 添加E2E测试基础设施(docker-compose + seed + test)
docker-compose.e2e.yml启动Gitea+assistant;seed.sh自动创建用户/仓库/Webhook/PR;test.sh轮询验证AI评论出现

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:46:43 +00:00
accelerator
20b7fae496 test: 添加集成测试(Store→Judge→Policy全链路)
验证完整数据流:入队→Agent findings→Judge去重→Policy分流→Store持久化→发布标记;覆盖幂等去重、重试恢复、并发安全

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:45:11 +00:00
accelerator
95cd9f1309 test: 添加ReAct循环单元测试
Mock OpenAI客户端验证:死循环防护(注入user消息)、fingerprint跨迭代去重、最后迭代强制json_object、工具调用错误处理

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:43:42 +00:00
accelerator
85ab286bf7 test: 添加文件存储和沙箱执行单元测试
覆盖原子写入、幂等去重、失败run清理、崩溃恢复;验证命令白名单、Token泄露修复、环境变量隔离

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:42:10 +00:00
accelerator
d7a70107a2 test: 添加发布策略和Judge代理单元测试
覆盖severity×confidence×humanGate全组合、dropped数组行为;验证fingerprint去重、权重排序、摘要文本

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:40:27 +00:00
accelerator
901ef97a25 docs: 更新README添加Agent审查模式文档
补充Agent模式架构说明、配置项文档和管理API接口说明

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:38:58 +00:00
accelerator
611fcf39d5 feat: 添加Agent审查相关配置项和依赖
新增REVIEW_ENGINE、向量记忆、Reflection/Debate等环境变量;添加@qdrant/js-client-rest和zod-to-json-schema依赖;添加test脚本

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:37:30 +00:00
accelerator
2ce2a5f6a6 feat: 集成Agent审查引擎到应用入口和控制器
webhook控制器支持agent模式的PR/commit入队;admin API新增review runs查询;feedback控制器支持人工审批反馈;Gitea服务扩展commit评论接口

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:36:01 +00:00
accelerator
25d4f56bde feat: 添加审查编排器和引擎入口
ReviewOrchestrator管理完整审查流程(workspace准备→Agent并行审查→Judge聚合→Policy过滤→Gitea发布);ReviewEngine实现任务队列和tick调度

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:34:27 +00:00
accelerator
5ddd858785 feat: 添加发布策略和文件审查存储
PublishPolicy按置信度/严重度/人工门禁分流findings为publishable/gated/dropped;FileReviewStore实现原子写入和失败run自动清理

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:33:03 +00:00
accelerator
4b58f158fc feat: 添加四个分类专家Agent定义
定义correctness、security、reliability、maintainability四个领域专家的focus prompt配置

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:31:33 +00:00
accelerator
1d9ed3d969 feat: 添加多Agent审查代理(specialist/reflexion/judge/critic/debate)
SpecialistAgent实现ReAct循环+指纹去重;ReflexionAgent添加自我反思机制;JudgeAgent聚合去重排序;CriticAgent质量评分;DebateOrchestrator多代理辩论

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:30:08 +00:00
accelerator
956a84acc1 feat: 添加向量记忆和学习系统
基于Qdrant的向量存储实现finding相似度搜索;LearningSystem支持误报学习和Few-shot示例生成

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:28:34 +00:00
accelerator
6186210b4e feat: 添加工具注册表和代码搜索工具
ToolRegistry统一管理Agent可用工具并转换为OpenAI Function格式;实现代码搜索、文件读取、函数引用搜索三个工具

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:26:47 +00:00
accelerator
d1e1e2f33c feat: 添加沙箱执行和本地仓库管理器
SandboxExec实现命令白名单和敏感信息脱敏;LocalRepoManager管理git mirror/worktree;DiffExtractor构建审查上下文

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:25:30 +00:00
accelerator
4c90bf0b9c feat: 添加Agent审查引擎核心类型和Schema定义
定义ReviewRun、Finding、ReviewContext等核心数据结构,以及基于Zod的finding响应校验Schema

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-01 03:24:12 +00:00