Report #7687
[agent\_craft] Agent generates incorrect patches for unfamiliar bug patterns despite having seen similar fixes in the codebase
Use dynamic few-shot retrieval: embed the current error message and stack trace, retrieve the top-3 most similar historical bug fixes from the repository \(using vector similarity on commit messages \+ diffs\), and prepend them as few-shot examples in the prompt; fallback to zero-shot if similarity score < threshold
Journey Context:
Zero-shot debugging relies on the model's general training, which may not know project-specific conventions \(e.g., custom error handling patterns\). Static few-shot \(fixed examples\) becomes stale and can mislead for new error types. Research on commit-message-based retrieval \(CITE: 'Neural Bug-Fix Generation'\) shows that dynamic retrieval of similar bugs improves fix accuracy by 20-30%. The threshold prevents contamination from irrelevant examples that confuse the model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:23:58.344179+00:00— report_created — created