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:
- Apply the patch to your local branch (or open a PR in GitHub/GitLab).
- Add unit tests that reproduce & verify the fix.
- 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 Fix | What you get |
---|---|
Copy/paste suggestions, resolve merge conflicts, pray CI passes | Zero‑conflict patch generated on the exact commit that failed |
Manually write regression tests | Auto‑generated tests with 80 %+ branch coverage |
Explain the change in PR description | AI‑authored markdown summarising root cause & fix |
Context switching between terminal ⇆ IDE ⇆ browser | Single in‑editor pop‑up: Accept Fix |
Prerequisites
Component | Minimum Version | Notes |
---|---|---|
DebuggAI CLI | ≥ 0.11.0 | npm i -g @debuggai/cli or brew install debuggai |
Extension (VS Code / JetBrains) | ≥ 0.7.0 | Marketplace / Plugins Hub |
Repo host | GitHub, GitLab, Bitbucket, or local git | Access token must have contents:write |
CI | Optional but recommended | We 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:
Setting | Default | Description |
---|---|---|
debuggai.fix.autoCommit | true | Commit patch automatically |
debuggai.fix.branchPrefix | fix/ | Branch name prefix |
debuggai.fix.openPr | true | Create PR after push |
debuggai.fix.testGenerator | "jest" | Test style (pytest , go-test , etc.) |
DEBUGGAI_FIX_MODE | patch | patch = modify current branch, pr = new PR |
Example:
{
"debuggai.fix.autoCommit": false,
"debuggai.fix.testGenerator": "pytest"
}
How it works 🛠️
- Patch synthesis – We rewrite only the faulty slices (≤ 30 LOC) plus adjacent signatures.
- Semantic merge – Uses Git’s
--apply
with--reject
fallback and a heuristic rebase to avoid churn. - Test generation – RAG retrieves similar historic tests; LLM creates new ones targeting the crash path.
- Safety checks – Runs
npm test
/pytest -q
locally (optional timeout 30 s). - 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 rollback –
debuggai fix --undo
resets the last patch. - Bulk mode –
debuggai 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
Symptom | Resolution |
---|---|
“Patch failed ✖︎” | Check for conflicting local changes; stash or commit before retrying. |
PR created but tests still failing | Open RCA tab in PR for alternative fix suggestions. |
Wrong test framework | Set 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! 🛠️✨