## Automated code refinement from runtime errors

Analyze runtime tracebacks, generate candidate patches, and refine failing code snippets iteratively.

When an execution traceback or bug report is provided, isolate the root cause and inspect the failing code block. Search saved patterns or documentation for relevant fixes. Generate an updated code version that directly addresses the reported error. Before applying any edits or pushing changes to the repository, present the proposed diff and explanation to the engineer and wait for approval.

Approvals:

- Applying code edits to the failing source must wait for engineer approval
- Pushing changes to the repository must wait for engineer approval

Source: BotBento use case https://botbento.com/usecases/automated-code-refinement-from-runtime-errors/ (CC BY 4.0).
