Skip to main content

Click to Fix — One‑Click Patch Application

Tired of copying code from an AI chat and hoping it compiles?
Click to Fix turns every DebuggAI diagnosis into a ready‑to‑merge change‑set. Press the ✨ Fix button (or hit ⌥⌘ F) and we:

  1. Apply the patch to your local branch (or open a PR in GitHub/GitLab).
  2. Add unit tests that reproduce & verify the fix.
  3. Re‑run the failing workflow to prove it passes.

Six seconds later you’re back in flow—bug gone, tests green. 🚀


Why you’ll love it ❤️

Pain without Click to FixWhat you get
Copy/paste suggestions, resolve merge conflicts, pray CI passesZero‑conflict patch generated on the exact commit that failed
Manually write regression testsAuto‑generated tests with 80 %+ branch coverage
Explain the change in PR descriptionAI‑authored markdown summarising root cause & fix
Context switching between terminal ⇆ IDE ⇆ browserSingle in‑editor pop‑up: Accept Fix

Prerequisites

ComponentMinimum VersionNotes
DebuggAI CLI ≥ 0.11.0npm i -g @debuggai/cli or brew install debuggai
Extension (VS Code / JetBrains) ≥ 0.7.0Marketplace / Plugins Hub
Repo hostGitHub, GitLab, Bitbucket, or local gitAccess token must have contents:write
CIOptional but recommendedWe trigger the same workflow on patch push

Workflow 🌱

1 · Trigger

  • Hover a red squiggle (Error Tracing) and click Fix
  • Or run from terminal:
debuggai fix DG-4f22e3

2 · Preview diff

A side panel shows:

  • Patch – code changes with inline comments
  • New tests – filename & assertion summary
  • Docstring / comments – traced back to RCA

3 · Accept or Edit

  • Accept – patch is applied to fix/DG‑4f22e3 branch and staged
  • Edit – opens diff in your editor to tweak before committing

4 · Commit & Push

CLI runs:

git add -u
git commit -m "fix(user-service): null check in validateUserPermissions (DG-4f22e3)"
git push --set-upstream origin fix/DG‑4f22e3

If a remote repo is configured, a PR/MR is opened with labels bug + debuggai‑fix.

5 · CI & Merge

  • CI pipeline re‑runs affected tests
  • Status shows DebuggAI Fix Verified ✅
  • Merge when happy—done.

Configuration

Configure behaviour in settings.json (VS Code) or env vars:

SettingDefaultDescription
debuggai.fix.autoCommittrueCommit patch automatically
debuggai.fix.branchPrefixfix/Branch name prefix
debuggai.fix.openPrtrueCreate PR after push
debuggai.fix.testGenerator"jest"Test style (pytest, go-test, etc.)
DEBUGGAI_FIX_MODEpatchpatch = modify current branch, pr = new PR

Example:

{
"debuggai.fix.autoCommit": false,
"debuggai.fix.testGenerator": "pytest"
}

How it works 🛠️

  1. Patch synthesis – We rewrite only the faulty slices (≤ 30 LOC) plus adjacent signatures.
  2. Semantic merge – Uses Git’s --apply with --reject fallback and a heuristic rebase to avoid churn.
  3. Test generation – RAG retrieves similar historic tests; LLM creates new ones targeting the crash path.
  4. Safety checks – Runs npm test/pytest -q locally (optional timeout 30 s).
  5. PR authoring – Includes RCA summary, screenshot of failing stack trace, and coverage diff badge.

Privacy – Only diff hunks & embeddings are sent remotely


Tips & Tricks

  • Instant rollbackdebuggai fix --undo resets the last patch.
  • Bulk modedebuggai fix --all --since "24h" patches every new error in one PR.
  • Pair review – Mention @debuggai-bot in PR comments to regenerate an alternative approach.
  • CI‑only – Disable local apply (DEBUGGAI_FIX_MODE=pr) to have fixes arrive as PRs for review first.

Troubleshooting

SymptomResolution
“Patch failed ✖︎”Check for conflicting local changes; stash or commit before retrying.
PR created but tests still failingOpen RCA tab in PR for alternative fix suggestions.
Wrong test frameworkSet debuggai.fix.testGenerator to your project’s default.

Next Steps

  • Error Tracing – See how errors become squiggles in real time.
  • Jump to Error – Hop from terminal logs straight into the failing line.
  • Autofix Policies – Set rules to auto‑merge low‑risk fixes off‑hours.

Click to Fix turns noisy logs into merged code—no context‑switching required.
Give it a spin and feel the feedback loop disappear. Happy shipping! 🛠️✨