Component: ErrorFixingMixin
Module:
gaia_agent_code.tools.error_fixing
Import: from gaia_agent_code.tools.error_fixing import ErrorFixingMixinOverview
ErrorFixingMixin provides automatic error detection and fixing capabilities using LLM-driven analysis. It handles syntax errors, linting issues, runtime errors, and includes workflow planning tools for complex projects. Key Features:- Automatic syntax error detection and fixing
- LLM-based code correction
- Pylint error fixing with iteration
- Runtime error fixing
- Architectural plan generation
- Project structure creation
- Workflow planning
- GAIA.md initialization from codebase
Tool Specifications
1. auto_fix_syntax_errors
Scan project for syntax errors and fix them automatically. Parameters:project_path(str, required): Path to project directory
2. fix_code
Fix Python code using LLM analysis. Parameters:file_path(str, required): Path to file to fixerror_description(str, optional): Error description
3. fix_linting_errors
Fix pylint issues iteratively. Parameters:file_path(str, required): Path to filelint_issues(List[Dict], required): Pylint issues
4. fix_python_errors
Fix runtime errors automatically. Parameters:file_path(str, required): Path to fileerror_message(str, required): Runtime error message
- NameError (add missing imports)
- IndentationError (fix spacing)
- TypeError (add type checking)
5. create_architectural_plan
Generate architectural plan for a project. Parameters:query(str, required): Project requirementsproject_type(str, optional): “application”, “library”, “game”, “api”
6. create_project_structure
Create folder structure from architectural plan. Parameters: None (uses self.plan) Returns:7. implement_from_plan
Implement components from architectural plan. Parameters:component(str, optional): Specific component to implementauto_implement_all(bool, optional): Implement all (default: False)
8. init_gaia_md
Initialize GAIA.md from codebase analysis. Parameters:project_root(str, optional): Root directory (default: ”.”)
9. create_workflow_plan
Plan a complex multi-step workflow. The code agent uses this when a user request can’t be satisfied by a single tool call — it decomposes the request into an ordered plan of tool invocations the agent then executes. Parameters:query(str, required): Natural-language description of the workflow to plan
Usage Examples
Example 1: Auto-Fix Syntax Errors
Example 2: Fix Code with LLM
Example 3: Fix Linting Errors
Example 4: Create Architectural Plan
Example 5: Initialize GAIA.md
LLM-Based Fixing
Fix Code Prompt Template
Project Templates
Game Project Structure
API Project Structure
Testing Requirements
File:tests/agents/code/test_error_fixing.py
Dependencies
ErrorFixingMixin Technical Specification