Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions holmes/core/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,14 @@ def add_or_update_system_prompt(

"""
template_path = "builtin://generic_ask_conversation.jinja2"

# Import at function level to avoid circular imports
from holmes.config import Config
Comment on lines +274 to +276

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove redundant local import.

Config is already imported at the module level (line 5). The local import creates redundancy and potential confusion. If there were truly circular import issues, the existing module-level import would already fail.

-    # Import at function level to avoid circular imports
-    from holmes.config import Config
-
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Import at function level to avoid circular imports
from holmes.config import Config
🤖 Prompt for AI Agents
In holmes/core/conversations.py around lines 274 to 276, remove the local import
of Config inside the function since Config is already imported at the module
level on line 5. This redundant import is unnecessary and can be safely deleted
to avoid confusion and maintain cleaner code.


context = {
"toolsets": ai.tool_executor.toolsets,
"cluster_name": config.cluster_name,
"runbooks": Config.get_runbook_catalog(),
}

system_prompt = load_and_render_prompt(template_path, context)
Expand Down
1 change: 1 addition & 0 deletions holmes/plugins/prompts/generic_ask_conversation.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Use conversation history to maintain continuity when appropriate, ensuring effic

{% include '_general_instructions.jinja2' %}

{% include '_runbook_instructions.jinja2' %}

# Style guide
* Reply with terse output.
Expand Down