Skip to content

Commit c84b97b

Browse files
committed
[FIX] Discussions
1 parent 1badec2 commit c84b97b

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/agents/ai_rules_generator.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ class AIRulesGeneratorConfig(BaseModel):
7979
class 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 = {}

src/agents/analyzer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ async def run(self):
111111

112112
self.validate_succession(analysis_files)
113113

114-
115114
def validate_succession(self, analysis_files: List[Path]):
116115
missing_files = []
117116
for file in analysis_files:
@@ -170,11 +169,11 @@ async def _run_agent(self, agent: Agent, user_prompt: str, file_path: Path):
170169
trace.get_current_span().set_attribute(f"{agent.name} result", result.output)
171170

172171
except UnexpectedModelBehavior as e:
173-
Logger.info(f"Unexpected model behavior: {e}")
174-
raise e
172+
Logger.info(f"Unexpected model behavior: {e}", exc_info=True)
173+
raise
175174
except Exception as e:
176-
Logger.info(f"Error running agent: {e}")
177-
raise e
175+
Logger.info(f"Error running agent: {e}", exc_info=True)
176+
raise
178177

179178
@property
180179
def _llm_model(self) -> Tuple[Model, ModelSettings]:

src/agents/prompts/ai_rules_generator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ agents:
1515
### CLAUDE.md (Claude Code Configuration)
1616
- **Purpose**: Persistent context for Claude Code sessions
1717
- **Format**: Markdown with flexible structure
18-
- **Length**: Aim for ~500 lines maximum (be concise)
18+
- **Length**: Target: 500 lines maximum (flexible, but be concise)
1919
- **Tone**: Conversational, helpful, informative
2020
- **Audience**: Claude AI during coding sessions
2121
- **Content**:

0 commit comments

Comments
 (0)