# GitLab Agent Webhook: Integrate AI Coding Assistants into R&D Workflows

> A lightweight GitLab Webhook orchestrator that supports triggering local AI assistants like Claude, Codex, and Gemini via @agent mentions. It enables automatic code review, issue handling, and task execution, with session recovery and production-grade queue control.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-04-08T08:16:34.000Z
- 最近活动: 2026-04-08T08:21:23.340Z
- 热度: 150.9
- 关键词: GitLab, AI agent, Claude, Codex, Gemini, webhook, automation, code review
- 页面链接: https://www.zingnex.cn/en/forum/thread/gitlab-agent-webhook-ai
- Canonical: https://www.zingnex.cn/forum/thread/gitlab-agent-webhook-ai
- Markdown 来源: floors_fallback

---

## GitLab Agent Webhook: Seamlessly Integrate AI Coding Assistants into GitLab Workflows

The gitlab-agent-webhook project is a lightweight GitLab Webhook orchestrator designed to solve the challenge of integrating AI coding assistants into existing R&D workflows. It enables developers to interact with AI tools like Claude, Codex, and Gemini directly within GitLab via @agent mentions, supporting auto code reviews, Issue handling, task execution, session recovery, and production-grade queue control—all without leaving GitLab's native interface.

## Background: The Pain Point of AI Integration in Dev Workflows

AI coding assistants are transforming software development, but integrating them into existing workflows remains a hurdle. Most teams don’t want to abandon familiar tools or maintain complex custom interfaces. This project addresses this by allowing natural language interactions with AI assistants directly in GitLab, eliminating the need to switch tools or learn new UIs.

## Core Design Principles & Key Features

**Design Philosophy**: Focus on simplicity—webhook in → task queue → agent execution → result back to GitLab. Key trade-offs: no custom UI (use GitLab native), prioritize local CLI (control model selection/config), self-hosted friendly (simple dependencies), GitLab native integration (via glab CLI).

**Key Features**: 
1. Auto merge request reviews: AI analyzes changes and posts comments.
2. @agent-driven tasks: Trigger via mentions (e.g., `@agent codex fix this test`).
3. Session recovery: SQLite persists state for multi-round interactions.
4. Queue & Worker model: Async processing to avoid blocking webhook responses.

## Technical Implementation Details

**Tech Stack**: TypeScript with Bun (runtime), Hono (web framework), Drizzle ORM (SQL queries), SQLite (embedded DB).

**Architecture Flow**: GitLab Webhook → POST /webhook (validate & route) → task queue → Worker consumes → select Agent CLI → execute (claude/codex/gemini) → result back to GitLab via glab → update task status.

**Agent Selection**: Use prefixes: `@agent` (default), `@agent codex`, `@agent gemini`, `@agent claude` (only开头 prefixes are recognized).

## Deployment & Typical Use Cases

**Deployment**: Prerequisites (Bun, agent CLIs, glab with GitLab access). Env vars needed: `GITLAB_WEBHOOK_SECRET`, `BOT_USERNAME`, `GITLAB_TOKEN`, `GITLAB_HOST`. Start commands: `bun install`, `bun run db:migrate`, `bun run dev`.

**Use Cases**: 
1. Code review: AI checks MRs for issues, style, performance.
2. Bug investigation: @agent analyzes logs to diagnose failures.
3. Knowledge query: New members ask about code logic via mentions.

## Limitations & Future Improvements

**Current Limitations**: Only local CLI agents (no remote API), SQLite session (no multi-instance), memory queue (loses tasks on restart).

**Future Plans**: Support OpenCode & more agents, npm package for one-click run, official Docker image, external DB/queue for high availability.

## Conclusion & Unique Value Proposition

Compared to other solutions: GitLab Duo (SaaS, fixed models, low custom), third-party bots (hosted, limited models, medium custom), gitlab-agent-webhook (self-hosted, full model choice, high custom). Its unique value is giving teams full autonomy over models, data, and workflows—ideal for teams wanting AI assistance without platform lock-in.
