Inspiration
As a developer, I often ran into pipeline failures caused by missing dependencies or configuration errors. Fixing these manually is repetitive and time-consuming. I wanted to create a tool that could automatically detect common pipeline errors and apply fixes, saving developers time and improving CI/CD reliability. The idea came from noticing that AI could be used not just for code generation, but also for maintaining code health in real-time.
What it does
The Self-Healing GitLab Agent monitors GitLab pipeline logs for errors such as missing modules (ModuleNotFoundError). When an error occurs:
- The Node.js agent receives webhook notifications from GitLab.
- The AI engine (Python + FastAPI) analyzes the logs and determines the required fix.
- The agent creates a new branch, updates the necessary files (like requirements.txt), and opens a merge request in GitLab with the fix. This allows pipelines to recover automatically without manual intervention, keeping development flowing smoothly.
How I built it
Node.js Agent: Listens for GitLab webhook events and communicates with the AI engine. Python + FastAPI AI Engine: Receives logs, analyzes errors, and returns suggested fixes. GitLab API Integration: Automatically creates branches, commits, and merge requests based on AI recommendations. Ngrok: Exposes local agent to GitLab webhooks during development. The agent is configured via a .env file with your GitLab Project ID and Project Access Token, keeping sensitive information secure. I also included error handling to ensure the agent gracefully reports failures and prevents token misuse.
Challenges I ran into
GitLab token permissions: Initially, pipeline fix requests were failing with 403 errors because tokens didn’t have the correct scopes. Switching to a Project Access Token with api and write_repository scopes solved this. Webhook testing locally: Testing webhooks required using Ngrok to expose the local server. Managing multiple tunnels was tricky at first. AI suggestions accuracy: The AI engine sometimes needed tuning to correctly parse error logs and generate valid fixes.
Accomplishments that am're proud of
Fully automated error detection and fix deployment in GitLab. Integration of Node.js agent + Python AI engine working seamlessly. Ability to auto-create branches and merge requests, reducing manual work for developers. Secure configuration with .env files and Project Access Tokens.
What i learned
How to use GitLab API for automation tasks like branching, committing, and opening merge requests. Building a microservices setup with Node.js and Python communicating over HTTP. Using AI for real-time code maintenance, not just generation. Best practices for managing sensitive tokens and environment variables.
What's next for Self-Healing GitLab Agent
Extend AI engine to handle more error types, like linting failures, test failures, and configuration errors. Add a dashboard for monitoring pipeline health and automated fixes. Explore GitHub Actions integration, making the agent usable for both GitLab and GitHub pipelines. Open-source the project with detailed instructions and demo videos for community adoption.
Built With
- api
- express.js
- fastapi
- github
- gitlab
- ngrok
- node.js
- python


Log in or sign up for Devpost to join the conversation.