Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codebase_rag/services/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def create_rag_orchestrator(tools: list[Tool]) -> Agent:
model=llm,
system_prompt=RAG_ORCHESTRATOR_SYSTEM_PROMPT,
tools=tools,
retries=3, # Increase retries to handle output validation issues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding retries is a good way to handle transient LLM issues, hardcoding the value 3 makes it inflexible. It would be better to make this configurable, similar to other settings like thinking_budget.

This would involve:

  1. Adding ORCHESTRATOR_RETRIES: int | None = None to AppConfig in codebase_rag/config.py.
  2. Adding a retries: int | None = None field to the ModelConfig dataclass.
  3. Populating this field from the environment variable in AppConfig._get_default_config.

Then you could use it here like this:

Suggested change
retries=3, # Increase retries to handle output validation issues
retries=config.retries or 3, # Use configured retries, default to 3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline comment violates project's "No Comments" policy - must be prefixed with (H) or removed

Suggested change
retries=3, # Increase retries to handle output validation issues
retries=3, # (H) Increase retries to handle output validation issues

Context Used: Rule from dashboard - ## Technical Requirements

Agentic Framework

  • PydanticAI Only: This project uses PydanticAI... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: codebase_rag/services/llm.py
Line: 114

Comment:
inline comment violates project's "No Comments" policy - must be prefixed with `(H)` or removed

```suggestion
            retries=3,  # (H) Increase retries to handle output validation issues
```

**Context Used:** Rule from `dashboard` - ## Technical Requirements

### Agentic Framework
- **PydanticAI Only**: This project uses PydanticAI... ([source](https://app.greptile.com/review/custom-context?memory=d4240b05-b763-467a-a6bf-94f73e8b6859))

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

)
except Exception as e:
raise LLMGenerationError(f"Failed to initialize RAG Orchestrator: {e}") from e