ErrorFixer is an intelligent AI agent integrated with Telex.im that analyzes code errors, detects programming languages, explains root causes, and provides accurate fixes. Built with Laravel and powered by Google Gemini AI.
- π Automatic Language Detection - Identifies PHP, JavaScript, Python, and more
- π Error Classification - Categorizes syntax, runtime, and logic errors
- π‘ Root Cause Analysis - Explains what went wrong and why
- π§ Smart Fixes - Provides corrected code snippets
- π± Dual Interface - Works on Telex.im chat and REST API
- β‘ Fast Response - Powered by Gemini 2.5 Flash
- PHP 8.1 or higher
- Laravel 10.x or higher
- Composer
- Google Gemini API Key
- Telex.im account
git clone https://github.com/yourusername/error-fixer-agent.git
cd error-fixer-agentcomposer installcp .env.example .env
php artisan key:generateEdit .env and add:
GEMINI_API_KEY=your_gemini_api_key_here
APP_URL=https://your-app-url.comGet your Gemini API key from: https://makersuite.google.com/app/apikey
Create or update config/laragent.php:
<?php
return [
'providers' => [
'gemini' => [
'api_key' => env('GEMINI_API_KEY'),
],
],
];# Install Railway CLI
npm install -g @railway/cli
# Login
railway login
# Deploy
railway upYour endpoint will be: https://your-app.up.railway.app/api/error-fix
Create a file named workflow.json:
{
"active": true,
"category": "utilities",
"description": "Detect, explain, and fix syntax or runtime code errors safely.",
"id": "laravelErrorFixAgent01",
"long_description": "You are a professional debugging and code repair assistant.\n\n### ROLE:\nYou analyze code and error messages to:\n1. Detect what programming language the code or error belongs to (PHP, JavaScript, Python, etc.).\n2. Identify the error type (SyntaxError, RuntimeError, Missing Variable, etc.).\n3. Explain clearly what caused the issue.\n4. Suggest a safe, corrected version of the code.\n5. Never execute or simulate the code β only analyze logically.\n6. If the code is unsafe (e.g., includes system commands, file access, eval, etc.), respond with: { \"error\": \"Input contains unsafe or malicious content.\" }\n\n### RESPONSE RULES:\n- Always return clean, valid JSON in this format:\n {\n \"language\": \"Detected programming language name\",\n \"error_type\": \"Type of error (syntax, runtime, logic, etc.)\",\n \"cause\": \"Explanation of what caused the issue.\",\n \"fix\": \"Proposed corrected code snippet or safe adjustment.\",\n \"notes\": \"Advice on how to avoid the issue in the future.\"\n }\n- Never add introductions or Markdown formatting.\n- Never output text outside the JSON structure.",
"name": "Error Fix Agent",
"nodes": [
{
"id": "debug-code-node",
"name": "Error Fix Agent",
"parameters": {
"error": "string (REQUIRED - raw code or error message to analyze)"
},
"position": [500, 150],
"type": "a2a/mastra-a2a-node",
"typeVersion": 1,
"url": "https://error-fix-agent-production.up.railway.app/error-fix"
}
],
"settings": {
"executionOrder": "v1"
},
"short_description": "Analyze and fix raw code or error messages safely. Always return valid JSON with language, error type, cause, fix, and notes."
}- Go to https://telex.im
- Navigate to your workspace
- Go to Home β AI cowoker β Add new co-Worker
- click on profile and click on configure workflow
- Upload your
workflow.json - Activate the agent
Send messages to your agent on Telex:
- "hi" β Get welcome message
- "PHP Fatal error: Call to undefined method" β Get error analysis
POST https://error-fix-agent-production.up.railway.app/error-fix
### Request Format (Telex.im)
```json
{
"event": {
"message": {
"text": "your error message or greeting"
}
}
}
{
"error": "PHP Fatal error: Call to undefined method User::fullname()"
}Or:
{
"text": "JavaScript TypeError: Cannot read property of undefined"
}{
"text": "π§ *Code Analysis*\n\nπΉ Language: PHP\nπΉ Error Type: Fatal Error\n\nπ‘ Cause:\nThe method fullname() does not exist...\n\nπ§ Fix:\n...\n\nπ Notes:\n..."
}{
"language": "PHP",
"error_type": "Fatal Error",
"cause": "The method fullname() does not exist in the User class.",
"fix": "Define the method: public function fullname() { return $this->first_name . ' ' . $this->last_name; }",
"notes": "Always ensure methods are defined before calling them."
}Greeting Test:
POST https://error-fix-agent-production.up.railway.app/error-fix
Content-Type: application/json
{
"text": "hi"
}Error Analysis Test:
POST https://error-fix-agent-production.up.railway.app/error-fix
Content-Type: application/json
{
"error": "PHP Parse error: syntax error, unexpected '}' in /app.php on line 42"
}- Open your Telex workspace
- Find your ErrorFixer agent
- Send:
hi - Send:
PHP Fatal error: Call to undefined function mysqli_connect()
Eda Cynthia Itsekirimi