-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSyntaxLogicAgent.py
More file actions
32 lines (26 loc) · 1.03 KB
/
SyntaxLogicAgent.py
File metadata and controls
32 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from BaseAgent import BaseAgent
class SyntaxLogicAgent(BaseAgent):
def __init__(self, config):
super().__init__(
"Syntax & Logic Agent",
"code correctness and logic error detection specialist",
config
)
def get_prompt(self, code: str) -> str:
return f"""Analyze this code for syntax errors, logic bugs, and correctness issues:
{code}
Focus ONLY on actual errors and bugs:
1. Syntax errors or near-syntax issues
2. Logic errors (off-by-one, incorrect conditions, infinite loops)
3. Type mismatches or incorrect type usage
4. Unreachable code or dead code paths
5. Resource leaks (unclosed files, connections)
6. Race conditions or concurrency issues
7. Incorrect algorithm implementation
DO NOT report on style, naming conventions, or best practices - only actual bugs.
If there are no syntax or logic errors, simply state "No syntax or logic errors found."
For each issue found, specify:
- The line number where it occurs
- What the error is
- Why it's wrong
- How to fix it"""