God Agent CI commited on
Commit ·
1da73ff
1
Parent(s): d78bb58
fix: Python 3.11 SyntaxError in debug_agent.py - backslash in f-string expression
Browse files- Fixed analyze_error() and self_heal_loop() - removed backslash from f-string expressions
- Used string concatenation instead for Python 3.11 compatibility
- Updated Dockerfile to clear pycache on build
- Synced latest agents from main repo
Root cause: f-strings with backslash in expression part not allowed in Python < 3.12
Fix: Changed f-string with backslash to string concatenation
Files changed (3)
- Dockerfile+3
- README.md+13
- agents/debug_agent.py+21-16
13 unmodified lines14151617181913 unmodified lines# Copy backend sourceCOPY . .# Workspace dirRUN mkdir -p /tmp/god_workspace13 unmodified lines14151617181920212213 unmodified lines# Copy backend sourceCOPY . .# Remove pycache to avoid stale bytecodeRUN find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true# Workspace dirRUN mkdir -p /tmp/god_workspace
13 unmodified lines14151613 unmodified lines**Autonomous Engineering Platform — Manus + Genspark + Devin (OneHand)**16-agent system for autonomous software engineering.13 unmodified lines1415161718192021222324252627282913 unmodified lines**Autonomous Engineering Platform — Manus + Genspark + Devin (OneHand)**16-agent system for autonomous software engineering.## Features- 16 specialized AI agents- Multi-model AI routing (OpenAI → Groq → Anthropic)- Real-time WebSocket streaming- Autonomous code generation, debugging, and deployment- File system management and Git operations## API Endpoints- `GET /` — Status- `GET /api/docs` — Swagger UI- `POST /api/v1/tasks/` — Create task- `WS /ws/chat/{session_id}` — Chat WebSocket
43 unmodified lines44454647484950515253545515 unmodified lines717273747576777879808182838426 unmodified lines11111211311411511611711811912022 unmodified lines14314414514614714814943 unmodified linesmessages = [{"role": "system", "content": DEBUG_SYSTEM},{"role": "user", "content": (f"Debug and fix this issue (attempt {attempt}):\n\n"f"{task}\n\n"f"Provide:\n"f"1. Root cause analysis\n"f"2. Exact fix (code/config)\n"f"3. Prevention strategy")},]15 unmodified linesasync def analyze_error(self, error_output: str, source_code: str = "", task_id: str = "", session_id: str = "") -> Dict:"""Deep error analysis with structured output."""messages = [{"role": "system", "content": DEBUG_SYSTEM},{"role": "user", "content": (f"Analyze this error and provide structured diagnosis:\n\n"f"Error:\n{error_output[:2000]}\n\n"f"{'Source Code:\\n```\\n' + source_code[:1000] + '\\n```' if source_code else ''}\n\n"f"Respond with JSON:\n"f'{{"error_type": "...", "root_cause": "...", "fix": "...", "prevention": "...", "severity": "low|medium|high|critical"}}')},]raw = await self.llm(messages, task_id=task_id, session_id=session_id, temperature=0.1, max_tokens=1000)26 unmodified linesmessages = [{"role": "system", "content": DEBUG_SYSTEM},{"role": "user", "content": (f"Fix attempt {attempt}/{max_retries}:\n\n"f"Error: {current_error}\n\n"f"Code:\n```\n{current_code[:3000]}\n```\n\n"f"Return ONLY the fixed code.")},]22 unmodified linescompile(code, "<string>", "exec")return {"valid": True, "error": ""}except SyntaxError as e:return {"valid": False, "error": f"SyntaxError: {e}"}except Exception as e:return {"valid": False, "error": str(e)}43 unmodified lines44454647484950515253545515 unmodified lines7172737475767778798081828384858687888926 unmodified lines11611711811912012112212312412522 unmodified lines14814915015115215315443 unmodified linesmessages = [{"role": "system", "content": DEBUG_SYSTEM},{"role": "user", "content": ("Debug and fix this issue (attempt " + str(attempt) + "):\n\n"+ task + "\n\n""Provide:\n""1. Root cause analysis\n""2. Exact fix (code/config)\n""3. Prevention strategy")},]15 unmodified linesasync def analyze_error(self, error_output: str, source_code: str = "", task_id: str = "", session_id: str = "") -> Dict:"""Deep error analysis with structured output."""if source_code:source_section = "Source Code:\n```\n" + source_code[:1000] + "\n```"else:source_section = ""messages = [{"role": "system", "content": DEBUG_SYSTEM},{"role": "user", "content": ("Analyze this error and provide structured diagnosis:\n\n""Error:\n" + error_output[:2000] + "\n\n"+ source_section + "\n\n""Respond with JSON:\n"'{"error_type": "...", "root_cause": "...", "fix": "...", "prevention": "...", "severity": "low|medium|high|critical"}')},]raw = await self.llm(messages, task_id=task_id, session_id=session_id, temperature=0.1, max_tokens=1000)26 unmodified linesmessages = [{"role": "system", "content": DEBUG_SYSTEM},{"role": "user", "content": ("Fix attempt " + str(attempt) + "/" + str(max_retries) + ":\n\n""Error: " + current_error + "\n\n""Code:\n```\n" + current_code[:3000] + "\n```\n\n""Return ONLY the fixed code.")},]22 unmodified linescompile(code, "<string>", "exec")return {"valid": True, "error": ""}except SyntaxError as e:return {"valid": False, "error": "SyntaxError: " + str(e)}except Exception as e:return {"valid": False, "error": str(e)}
Dockerfile+3
README.md+13
agents/debug_agent.py+21-16