Skip to content

Conversation

@aantn
Copy link
Contributor

@aantn aantn commented Jul 27, 2025

No description provided.

@aantn aantn requested review from arikalon1 and mainred July 27, 2025 14:51
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 27, 2025

Warning

Rate limit exceeded

@aantn has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c070912 and d2cc1b6.

📒 Files selected for processing (7)
  • CLAUDE.md (1 hunks)
  • docs/installation/python-installation.md (7 hunks)
  • holmes/interactive.py (2 hunks)
  • holmes/main.py (2 hunks)
  • holmes/plugins/prompts/generic_ask.jinja2 (1 hunks)
  • tests/llm/test_ask_holmes.py (4 hunks)
  • tests/llm/utils/test_case_utils.py (1 hunks)

Walkthrough

The changes refactor how system prompts are handled in the interactive "ask" workflow. The system prompt is no longer passed or rendered externally; instead, it is loaded and rendered within build_initial_ask_messages using the tool executor and optional runbooks. Function signatures and command-line options are updated accordingly to remove the system prompt parameter. The generic system prompt template was updated to optionally include additional prompt content. New tests were added to cover the updated prompt-building logic and file attachment handling.

Changes

File(s) Change Summary
holmes/core/prompt.py Refactored build_initial_ask_messages: removed system_prompt_rendered argument, now renders prompt internally using tool executor and optional runbooks. Updated docstring and function signature.
holmes/interactive.py Updated run_interactive_loop: removed system_prompt_rendered parameter, added runbooks and system_prompt_additions parameters, updated call to build_initial_ask_messages accordingly.
holmes/main.py Modified ask command: removed system_prompt option and related logic, added system_prompt_additions option, updated calls to match new prompt handling and parameters.
holmes/plugins/prompts/generic_ask.jinja2 Updated template to conditionally append system_prompt_additions content if provided.
tests/core/test_prompt.py Added comprehensive unit tests for build_initial_ask_messages and file appending functions, covering various parameter combinations and file attachment scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI (main.py)
    participant InteractiveLoop
    participant PromptBuilder
    participant ToolExecutor
    participant Runbooks

    User->>CLI (main.py): Run "ask" command
    CLI (main.py)->>InteractiveLoop: run_interactive_loop(..., runbooks, system_prompt_additions)
    InteractiveLoop->>PromptBuilder: build_initial_ask_messages(console, user_input, files, ToolExecutor, runbooks, system_prompt_additions)
    PromptBuilder->>ToolExecutor: Get toolsets
    PromptBuilder->>Runbooks: (Optional) Use runbooks in context
    PromptBuilder->>PromptBuilder: Render system prompt internally with additions
    PromptBuilder->>InteractiveLoop: Return initial messages
    InteractiveLoop->>User: Begin interactive session
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

  • feat(runbook): introduce runbook toolset to fetch internal runbooks #547: The main PR modifies the build_initial_ask_messages function and related interactive loop to internally load and render the system prompt with runbooks and system prompt additions, directly integrating runbook data into prompt construction, which is a functional extension of the runbook catalog and toolset infrastructure introduced in the retrieved PR.
  • Fix interactive mode so it can answer without follow up questions #546: The main PR changes the build_initial_ask_messages function to internally render the system prompt using a built-in template with tool executor and runbooks, and updates run_interactive_loop and ask command accordingly, while the retrieved PR refactors interactive mode and modifies build_initial_ask_messages to accept a rendered system prompt string but does not change it to internal rendering or add tool executor and runbooks parameters.

Suggested reviewers

  • mainred
  • moshemorad
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch system-prompt-loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

arikalon1
arikalon1 previously approved these changes Jul 27, 2025
Copy link
Contributor

@arikalon1 arikalon1 left a comment

Choose a reason for hiding this comment

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

LGTM

@aantn aantn enabled auto-merge (squash) July 29, 2025 05:40
@github-actions
Copy link
Contributor

Results of HolmesGPT evals

  • ask_holmes: 24/34 test cases were successful, 0 regressions, 1 skipped, 9 mock failures
Test suite Test case Status
ask 01_how_many_pods
ask 02_what_is_wrong_with_pod 🔧
ask 03_what_is_the_command_to_port_forward 🔧
ask 04_related_k8s_events ↪️
ask 05_image_version 🔧
ask 09_crashpod
ask 10_image_pull_backoff 🔧
ask 11_init_containers
ask 13_pending_node_selector
ask 14_pending_resources
ask 15_failed_readiness_probe
ask 17_oom_kill
ask 18_crash_looping_v2
ask 19_detect_missing_app_details 🔧
ask 24_misconfigured_pvc
ask 28_permissions_error
ask 29_events_from_alert_manager
ask 39_failed_toolset 🔧
ask 41_setup_argo0
ask 41_setup_argo1
ask 42_dns_issues_steps_new_tools 🔧
ask 43_current_datetime_from_prompt
ask 45_fetch_deployment_logs_simple
ask 51_logs_summarize_errors 🔧
ask 53_logs_find_term
ask 54_not_truncated_when_getting_pods 🔧
ask 59_label_based_counting
ask 60_count_less_than 🔧
ask 61_exact_match_counting
ask 63_fetch_error_logs_no_errors
ask 79_configmap_mount_issue 🔧
ask 83_secret_not_found 🔧
ask 89_runbook_missing_cloudwatch 🔧
ask 90_runbook_basic_selection 🔧

Legend

  • ✅ the test was successful
  • ↪️ the test was skipped
  • ⚠️ the test failed but is known to be flaky or known to fail
  • 🔧 the test failed due to mock data issues (not a code regression)
  • ❌ the test failed and should be fixed before merging the PR

@aantn aantn merged commit f4539ef into master Jul 29, 2025
11 checks passed
@aantn aantn deleted the system-prompt-loading branch July 29, 2025 05:48
@coderabbitai coderabbitai bot mentioned this pull request Aug 17, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants