Skip to main content

Auto-fix GitLab bugs with AI agents โ€” bring your own CLI or free API.

Project description

๐Ÿš€ FixFleet

Auto-fix GitLab bugs with AI agents โ€” bring your own CLI or free API.

Reads open Bug issues from GitLab โ†’ parses stack traces and steps โ†’ pre-narrows the search to relevant files โ†’ dispatches to your AI agent of choice โ†’ scores the fix's confidence. All locally. No commits. No lock-in.

License: MIT Python 3.9+ Tests Stdlib only PRs Welcome

One command. Any AI. Zero waste.

Claude Code ยท Codex ยท Gemini CLI ยท Cursor Agent ยท Aider ยท Qwen Code ยท Groq ยท Gemini API ยท OpenRouter ยท Cerebras ยท Ollama ยท LM Studio


๐ŸŽฏ What this tool does in one sentence: Pulls open bug tickets from GitLab, hands each one to an AI coding agent with the right context already pre-loaded, and scores how confident the fix is โ€” so you only review the ones worth reviewing.

Built by Yash Koladiya.


โœจ What it does

  1. Fetches open issues with the Bug label from any GitLab project (gitlab.com or self-hosted).
  2. Parses each issue body โ€” pulling out Description, Steps to Reproduce, Expected/Actual behavior, Logs, Stack Traces automatically.
  3. Pre-narrows the search space: extracts file paths, stack frames, symbols โ†’ ranks candidate files in your local repo so the AI doesn't waste tokens hunting.
  4. Dispatches the structured prompt to your chosen AI agent (CLI or API).
  5. Computes a confidence score for the fix using diff metrics + model self-rating + hedge-density.
  6. Tracks token usage per backend per day so you don't blow through paid quotas.
  7. Never commits or pushes โ€” leaves the working tree dirty for human review.

๐Ÿš€ Quick start

Install (pick one)

Option A โ€” pipx (recommended, isolated)

pipx install git+https://github.com/Yash-Koladiya30/fixfleet.git
fixfleet

Option B โ€” uv tool

uv tool install git+https://github.com/Yash-Koladiya30/fixfleet.git
fixfleet

Option C โ€” one-shot run via uvx (no install)

uvx --from git+https://github.com/Yash-Koladiya30/fixfleet.git fixfleet

Option D โ€” plain pip

pip install git+https://github.com/Yash-Koladiya30/fixfleet.git
fixfleet

Option E โ€” clone + run (for hacking on the code)

git clone https://github.com/Yash-Koladiya30/fixfleet.git
cd fixfleet
python3 fix_bugs.py

Pure stdlib โ€” no runtime dependencies. Works on Python 3.9+.

Upgrade

pipx upgrade fixfleet     # if installed with pipx
uv tool upgrade fixfleet  # if installed with uv

Uninstall

pipx uninstall fixfleet

๐Ÿ”Œ Backend options

You need at least one of these. Mix and match per session.

CLI backends (use existing paid plans)

CLI Install Login Plan source
Claude Code npm i -g @anthropic-ai/claude-code claude login Claude Pro/Max
Codex npm i -g @openai/codex codex login ChatGPT Plus/Pro
Gemini CLI npm i -g @google/gemini-cli gemini auth Google account (free tier)
Cursor Agent install from cursor.sh cursor-agent login Cursor Pro
Aider pip install aider-chat API key Bring your own
Qwen Code npm i -g @qwen-code/qwen-code OAuth or key Free tier

API backends (free tier-friendly)

Single OpenAI-compatible client serves all of these:

Provider Free? Get key
Groq โœ… Free, fast (~500 tok/s) https://console.groq.com/keys
Google Gemini โœ… Free tier, big quota https://aistudio.google.com/apikey
OpenRouter โœ… Many free models https://openrouter.ai/keys
Cerebras โœ… Free tier https://cloud.cerebras.ai
Ollama โœ… Local, no key, offline https://ollama.com
LM Studio โœ… Local, no key https://lmstudio.ai

๐Ÿ”‘ Generating a GitLab token

  1. Go to gitlab.com โ†’ top-right avatar โ†’ Edit profile โ†’ Access Tokens.
  2. Create a Personal Access Token with scope: api or read_api.
  3. Copy the glpat-... token. GitLab shows it once.
  4. Paste when FixFleet asks. Typing is hidden via getpass.

โš ๏ธ Never commit tokens. This repo's .gitignore already excludes .env, *.token, secrets.*, and the local config files (~/.bugfixer.json, ~/.bugfixer-state.json are stored in your home dir, NOT in the repo).


๐Ÿงญ Flow

Step 0  Choose Backend         โ†’ pick installed CLI or configure API
Step 1  GitLab Token           โ†’ paste glpat-...
Step 2  GitLab Project         โ†’ paste full URL (or short path / numeric ID)
Step 3  Local Project Dir      โ†’ path to cloned repo on your Mac
Step 4  Date Filter            โ†’ YYYY-MM-DD or Enter for all
Step 5  Fetching Issues        โ†’ auto-paginated
Step 6  Select Issues          โ†’ 1,3,5  |  all  |  unfixed  |  q
        โ†’ fixes each, shows budget + confidence per issue

After Step 0/2/3, defaults save to ~/.bugfixer.json โ€” next run press Enter to reuse.

Inputs accepted at Step 2

Input Auto-extracts
https://gitlab.com/group/project gitlab.com host + path
https://gitlab.com/group/project.git strips .git
https://gitlab.com/g/p/-/issues strips UI suffix
git@gitlab.com:group/project.git SSH form
https://gitlab.example.com/team/repo self-hosted host
group/project short form
12345 numeric ID

๐ŸŽฏ Confidence + Semantic Scoring

Every fix gets graded:

Confidence Report
  Final score:    0.84  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘  (High)
  Self-rating:    8/10
  Root cause:     Missing null check in handleSubmit
  Diff focus:     0.92
  File relevance: 0.85
  Hedge density:  1.2%
  Tests run:      no
  Files changed:  1  (12 lines)

Sources: model self-rating from the structured FIX REPORT block, git diff metrics, hedge-word density, file-relevance vs candidate list.


๐Ÿ’ฐ Token optimization

  • Locator pre-greps the repo for candidate files โ†’ top file inlined directly into prompt
  • Section caps trim long descriptions/logs before sending
  • Budget enforcement โ€” per-issue, session, daily caps in config
  • State persistence โ€” skips already-fixed issues, tracks daily usage per backend

Typical savings vs naive prompt: 60โ€“80% tokens for bugs with file/trace hints.


โš™๏ธ Configuration

Local config: ~/.bugfixer.json

{
  "default_backend": "claude",
  "default_project_id": "group/project",
  "default_project_host": "gitlab.com",
  "default_project_dir": "/Users/you/work/project",
  "api": {
    "preset": "groq",
    "base_url": "https://api.groq.com/openai/v1",
    "api_key": "gsk_...",
    "model": "llama-3.3-70b-versatile"
  },
  "budgets": {
    "session_max_tokens": 200000,
    "per_issue_max_tokens": 30000,
    "daily_max_tokens": 500000
  },
  "skip_already_fixed": true
}

๐Ÿ”’ Lives in your home directory, NOT the repo. The .gitignore excludes it from git regardless.

Override the backend per run with an env var:

BUGFIXER_BACKEND=codex python3 fix_bugs.py

๐Ÿงช Testing

python3 -m unittest tests.test_all -v

54+ unit tests cover parser, locator, budget, confidence, prompt, registry, diff-apply, state, config, URL parsing, path sanitization.


๐Ÿ“‚ Project layout

fixfleet/
โ”œโ”€โ”€ bugfixer/
โ”‚   โ”œโ”€โ”€ ui.py              terminal styling
โ”‚   โ”œโ”€โ”€ gitlab.py          API client + URL parser
โ”‚   โ”œโ”€โ”€ parser.py          issue-body section extractor
โ”‚   โ”œโ”€โ”€ locator.py         signal extraction + file ranking + inlining
โ”‚   โ”œโ”€โ”€ prompt.py          structured prompt builder
โ”‚   โ”œโ”€โ”€ budget.py          token slimming + estimation + caps
โ”‚   โ”œโ”€โ”€ confidence.py      diff metrics + self-rating + hedge density
โ”‚   โ”œโ”€โ”€ state.py           ~/.bugfixer-state.json
โ”‚   โ”œโ”€โ”€ config.py          ~/.bugfixer.json
โ”‚   โ”œโ”€โ”€ cli.py             interactive flow orchestration
โ”‚   โ””โ”€โ”€ backends/
โ”‚       โ”œโ”€โ”€ base.py        Backend ABC
โ”‚       โ”œโ”€โ”€ _subprocess.py tee runner
โ”‚       โ”œโ”€โ”€ registry.py    detect installed CLIs + API presets
โ”‚       โ”œโ”€โ”€ cli/           claude ยท codex ยท gemini ยท cursor ยท aider ยท qwen
โ”‚       โ””โ”€โ”€ api/openai_compat.py
โ”œโ”€โ”€ fix_bugs.py            entry shim
โ””โ”€โ”€ tests/test_all.py

๐Ÿ›ก๏ธ Security notes

  • Tokens / API keys typed via getpass โ€” never echoed to terminal, never written to repo.
  • All issue body content is fenced in the prompt with adaptive fence length to prevent prompt-injection from malicious issue authors.
  • The .gitignore excludes config + state files, common secret files (.env, *.token, *.key).
  • The tool never commits or pushes โ€” manual review required before sharing fixes.

๐Ÿž Troubleshooting

Symptom Fix
claude command not found Install one CLI or pick the API option in Step 0
HTTP 401 from GitLab Token expired or wrong scope (read_api/api needed)
HTTP 404 Wrong project URL/ID format
"No bugs found" GitLab issues need exact Bug label (case-sensitive)
Path with spaces fails Drag-drop folder from Finder works (auto-unescapes)
Want to reset config rm ~/.bugfixer.json ~/.bugfixer-state.json

๐Ÿค Contributing

Issues / PRs welcome. Guidelines:

  • Pure stdlib โ€” no requirements.txt dependencies in core
  • All new code paths need unit tests
  • Run python3 -m unittest tests.test_all before submitting

๐Ÿ“„ License

MIT โ€” see LICENSE. Built by Yash Koladiya.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fixfleet-0.3.0.tar.gz (43.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fixfleet-0.3.0-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file fixfleet-0.3.0.tar.gz.

File metadata

  • Download URL: fixfleet-0.3.0.tar.gz
  • Upload date:
  • Size: 43.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for fixfleet-0.3.0.tar.gz
Algorithm Hash digest
SHA256 00cf49deaeecdc2126d0b1e0b636fbd8bb88ede6eb1d7169ca01588946c0238b
MD5 688150ce22d6dc0771d457d489642f2c
BLAKE2b-256 cd697d96bae998461e45a74f856bfadd3c9e1bc4d6d7431d7dc77b2be51dd95a

See more details on using hashes here.

File details

Details for the file fixfleet-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fixfleet-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 41.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for fixfleet-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ecf19d10696a32de541bb95be242d56b26754b973f6d5cf7bfa6b316a342060
MD5 2ecbf45104d286716f55f612dadd2cc6
BLAKE2b-256 595297e6db378985d079897aab59e4958e52389e5d176053b363d112f8104fa4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page