@@ -79,9 +79,7 @@ class AIRulesGeneratorConfig(BaseModel):
7979class AIRulesGeneratorAgent :
8080 def __init__ (self , cfg : AIRulesGeneratorConfig ):
8181 self ._config = cfg
82- self ._prompt_manager = PromptManager (
83- file_path = Path (__file__ ).parent / "prompts" / "ai_rules_generator.yaml"
84- )
82+ self ._prompt_manager = PromptManager (file_path = Path (__file__ ).parent / "prompts" / "ai_rules_generator.yaml" )
8583
8684 async def run (self ) -> AIRulesOutput :
8785 Logger .info (f"Running AI rules generator agent with concurrent generation" )
@@ -268,7 +266,13 @@ async def _run_agent(self, agent: Agent, user_prompt: str, output_type: type, ag
268266 return result .output
269267
270268 except Exception as e :
271- Logger .error (f"Error running { agent_name } : { e } " )
269+ Logger .error (
270+ f"Error running { agent_name } " ,
271+ data = {
272+ "error" : str (e ),
273+ },
274+ exc_info = True ,
275+ )
272276 raise e
273277
274278 @property
@@ -348,9 +352,7 @@ def _cursor_rules_agent(self) -> Agent:
348352 model_settings = model_settings ,
349353 output_type = CursorRulesOutput ,
350354 retries = config .AI_RULES_AGENT_RETRIES ,
351- system_prompt = self ._prompt_manager .render_prompt (
352- "agents.cursor_rules_generator.system_prompt"
353- ),
355+ system_prompt = self ._prompt_manager .render_prompt ("agents.cursor_rules_generator.system_prompt" ),
354356 tools = [
355357 FileReadTool ().get_tool (),
356358 ],
@@ -396,9 +398,7 @@ def _render_cursor_rules_prompt(self, existing_files: dict[str, Optional[str]])
396398 ** analysis_files ,
397399 }
398400
399- return self ._prompt_manager .render_prompt (
400- "agents.cursor_rules_generator.user_prompt" , ** template_vars
401- )
401+ return self ._prompt_manager .render_prompt ("agents.cursor_rules_generator.user_prompt" , ** template_vars )
402402
403403 def _read_analysis_files (self ) -> dict [str , Optional [str ]]:
404404 analysis_files = {}
0 commit comments