Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
36a4af1
don't leak information in eval 20
aantn Jul 26, 2025
f9d670a
make evals 26 reproducible
aantn Jul 26, 2025
f72fe03
don't leak information in eval 26
aantn Jul 26, 2025
ca6eac6
fixes
aantn Jul 26, 2025
6be17da
more eval fixes
aantn Jul 26, 2025
3e53331
update eval tags after running all easy evals 20x
aantn Jul 26, 2025
d13a784
add evals summary table to pytest output + fail evals if setup fails
aantn Jul 26, 2025
7751565
Merge branch 'master' into fix-more-evals
aantn Jul 26, 2025
4a237f0
add eval docs
aantn Jul 26, 2025
c28008e
fixes to specific evals and tags
aantn Jul 26, 2025
afbf483
fix bug with environment variables in evals
aantn Jul 26, 2025
c9482e7
minor changes to mocking toolsets
aantn Jul 26, 2025
9518c9d
fix evals
aantn Jul 27, 2025
1c301f1
report test failures
aantn Jul 27, 2025
b150027
Update test_case.yaml
aantn Jul 27, 2025
7c37059
Update setup_cleanup.py
aantn Jul 27, 2025
234aa0b
WIP
aantn Jul 27, 2025
c576dad
improvements and bugfixes to evals framework
aantn Jul 27, 2025
d2a9753
mark eval as skipped
aantn Jul 27, 2025
b1f5fd9
only run regression evals in CI/CD
aantn Jul 27, 2025
92593b4
fix for ci/cd
aantn Jul 27, 2025
5fb6536
merge
aantn Jul 27, 2025
dc7db2c
Update tracing.py
aantn Jul 27, 2025
7934989
Merge branch 'eval-fixes3' into improve-transparency
aantn Jul 27, 2025
bf0e293
Merge branch 'master' into improve-transparency
aantn Jul 27, 2025
266342c
Merge branch 'master' into improve-transparency
aantn Jul 27, 2025
c09b94a
improve transparency around using runbooks
aantn Jul 27, 2025
4ac208d
evals + claude.md tweaks
aantn Jul 27, 2025
657255c
Update pyproject.toml
aantn Jul 28, 2025
236041d
Merge branch 'master' into improve-transparency
aantn Jul 28, 2025
0eb9f37
Merge branch 'master' into improve-transparency
aantn Jul 28, 2025
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
14 changes: 2 additions & 12 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,8 @@ poetry run pytest -vv -s tests/llm/test_ask_holmes.py -k "failing_test" --no-cov
poetry run pytest -m "llm and not network" --collect-only -q
```

**Available Test Markers**:
- `llm`: LLM behavior tests
- `datetime`: Datetime functionality
- `logs`: Log processing
- `context_window`: Context window handling
- `synthetic`: Synthetic data tests
- `network`: Network-dependent tests
- `runbooks`: Runbook functionality
- `misleading-history`: Misleading data scenarios
- `chain-of-causation`: Causation analysis
- `slackbot`: Slack integration
- `counting`: Resource counting tests
**Available Test Markers (same as eval tags)**:
Check in pyproject.toml and NEVER use a market/tag that doesn't exist there. Ask the user before adding a new one.
Comment thread
aantn marked this conversation as resolved.
Resolved

**Test Infrastructure Notes**:
- All test state tracking uses pytest's `user_properties` to ensure compatibility with pytest-xdist parallel execution
Expand Down
38 changes: 3 additions & 35 deletions holmes/plugins/prompts/_general_instructions.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* in this case, try to find substrings or search for the correct spellings
* always provide detailed information like exact resource names, versions, labels, etc
* even if you found the root cause, keep investigating to find other possible root causes and to gather data for the answer like exact names
* if a runbook url is present as well as tool that can fetch it, you MUST fetch the runbook before beginning your investigation.
* if a runbook url is present you MUST fetch the runbook before beginning your investigation
Comment thread
aantn marked this conversation as resolved.
Resolved
* when the user mentions any operational issue (high CPU, memory issues, database down, application errors, etc.), ALWAYS check if there's a matching runbook in the catalog first
* if you don't know, say that the analysis was inconclusive.
* if there are multiple possible causes list them in a numbered list.
* there will often be errors in the data that are not relevant or that do not have an impact - ignore them in your conclusion if you were not able to tie them to an actual error.
Expand All @@ -34,40 +35,7 @@

{% include '_fetch_logs.jinja2' %}

# Handling Permission Errors

If during the investigation you encounter a permissions error (e.g., `Error from server (Forbidden):`), **ALWAYS** follow these steps to ensure a thorough resolution:
1.**Analyze the Error Message**
- Identify the missing resource, API group, and verbs from the error details.
- Never stop at reporting the error
- Proceed with an in-depth investigation.
2.**Locate the Relevant Helm Release**
Check if Helm tools are available, if they are available always use Helm commands to help user find the release associated with the Holmes pod:
- Run `helm list -A | grep holmes` to identify the release name.
- Run `helm get values <RELEASE_NAME> -n <NAMESPACE>` to retrieve details such as `customClusterRoleRules` and `clusterName`.
If Helm tools are unavailable, skip this step.
3. **Check for Missing Permissions**
- Check for a cluster role with <RELEASE_NAME>-holmes-cluster-role in its name and a service account with <RELEASE_NAME>-holmes-service-account in its name to troubleshoot missing permissions where release name is the name you found earlier if helm tools are available (If the exact cluster role or service account isn't found, search for similar or related names, including variations or prefixes/suffixes that might be used in the cluster.)
- Focus on identifying absent permissions that align with the error message.
4. **Update the Configuration**
If necessary permissions are absent both in customClusterRoleRules and the cluster role mentioned previously, ALWAYS advise the user to update their configuration by modifying the `generated_values.yaml` file as follows:
```
holmes:
customClusterRoleRules:
- apiGroups: ["<API_GROUP>"]
resources: ["<RESOURCE_1>", "<RESOURCE_2>"]
verbs: ["<VERB_1>", "<VERB_2>", "<VERB_3>"]
```
After that instruct them to apply the changes with::
```
helm upgrade <RELEASE_NAME> robusta/robusta --values=generated_values.yaml --set clusterName=<YOUR_CLUSTER_NAME>
```
5. **Fallback Guidelines**
- If you cannot determine the release or cluster name, use placeholders `<RELEASE_NAME>` and `<YOUR_CLUSTER_NAME>`.
- While you should attempt to retrieve details using Helm commands, do **not** direct the user to execute these commands themselves.
Reminder:
* Always adhere to this process, even if Helm tools are unavailable.
* Strive for thoroughness and precision, ensuring the issue is fully addressed.
{% include '_permission_errors.jinja2' %}

# Special cases and how to reply

Expand Down
6 changes: 6 additions & 0 deletions holmes/plugins/prompts/_permission_errors.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Handling Permission Errors
Comment thread
aantn marked this conversation as resolved.
Resolved

If during the investigation you encounter a permissions error (e.g., `Error from server (Forbidden):`), **ALWAYS** follow these steps to ensure a thorough resolution:
1. Analyze the Error Message: Identify the missing resource, API group, and verbs from the error details.
2. Check which user/service account you're running with and what permissions it has
3. Report this to the user and refer them to https://robusta-dev.github.io/holmesgpt/data-sources/permissions/
18 changes: 13 additions & 5 deletions holmes/plugins/prompts/_runbook_instructions.jinja2
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{% if runbooks and runbooks.catalog|length > 0 %}
# Runbook Selection

## Available Runbooks
You (HolmesGPT) have access to a set of runbooks that provide step-by-step troubleshooting instructions for various known issues.
Comment thread
aantn marked this conversation as resolved.
Resolved
If one of the following runbooks relates to the user's issue, you MUST fetch it with the fetch_runbook tool.
Comment thread
aantn marked this conversation as resolved.
Resolved

## Available Runbooks for fetch_runbook tool
{% for runbook in runbooks.catalog %}
### description: {{ runbook.description }}
link: {{ runbook.link }}
{% endfor %}
ALWAYS try to find the runbooks that can provide troubleshooting instructions when the user describes an operational issue, debugging scenario, or asks for step‑by‑step troubleshooting.
To get the runbook details, use `fetch_runbook` tool by comparing the runbook description with the user prompt.
ALWAYS follow the steps described in the runbook.
If you decided not to follow one or more steps, ALWAYS explain why.

If there is a runbook that MIGHT match the user's issue, you MUST:
1. Fetch the runbook with the `fetch_runbook` tool.
2. Decide based on the runbook's contents if it is relevant or not.
3. If it seems relevant, inform the user that you accesses a runbook and will use it to troubleshoot the issue.
4. To the maximum extent possible, follow the runbook instructions step-by-step.
5. Provide a detailed report of the steps you performed, including any findings or errors encountered.
6. If a runbook step requires tools or integrations you don't have access to tell the user that you cannot perform that step due to missing tools.

{%- endif -%}
32 changes: 19 additions & 13 deletions holmes/plugins/prompts/_toolsets_instructions.jinja2
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Toolset Setup and Configuration Instructions

{%- set enabled_toolsets_with_instructions = [] -%}
{%- set disabled_toolsets = [] -%}

Expand All @@ -19,13 +21,13 @@
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{% if disabled_toolsets %}
# Disabled & failed Toolsets

# Disabled & failed Toolsets
{% if disabled_toolsets %}
The following toolsets are either disabled or failed to initialize:
{% for toolset in disabled_toolsets %}
* toolset "{{ toolset.name }}": {{ toolset.description }}
{%- if toolset.status == "failed" %}
{%- if toolset.status.value == "failed" %}
* status: The toolset is enabled but misconfigured and failed to initialize.
{%- if toolset.error %}
* error: {{ toolset.error }}
Expand All @@ -37,20 +39,24 @@ The following toolsets are either disabled or failed to initialize:
* setup instructions: {{ toolset.docs_url }}
{%- endif -%}
{%- endfor %}
{% else %}
<no toolsets are disabled or failed>
{% endif %}

If you need a toolset to access a system that you don't otherwise have access to:
- Check the list of toolsets above and see if any loosely match the needs
- If the toolset has `status: failed`: Tell the user and copy the error in your response for the user to see
- If the toolset has `status: disabled`: Ask the user to configure the it.
- If the toolset has `status: disabled`: Ask the user to configure it.
- Share the setup instructions URL with the user
- Invoke the tool fetch_webpage on the toolset URL and summarize setup steps
- If there are no relevant toolsets in the list below, tell the user that you are missing an integration to access XYZ:
you should give an answer similar to "I don't have access to <system>. Please add a Holmes integration for <system> so
that I can investigate this."
{% else %}
- If there are no relevant toolsets in the list above, tell the user that you are missing an integration to access XYZ:
You should give an answer similar to "I don't have access to <system>. To add a HolmesGPT integration for <system> you can [connect an MCP server](https://robusta-dev.github.io/holmesgpt/data-sources/remote-mcp-servers/) or add a [custom toolset](https://robusta-dev.github.io/holmesgpt/data-sources/custom-toolsets/)."

# Disabled & failed Toolsets
Likewise, if users ask about setting up or configuring integrations (e.g., "How can I give you access to ArgoCD applications?"):
ALWAYS check if there's a disabled or failed toolset that matches what the user is asking about. If you find one:
1. If the toolset has a specific documentation URL (toolset.docs_url), ALWAYS direct them to that URL first
2. If no specific documentation exists, then direct them to the general Holmes documentation:
- For all toolset configurations: https://robusta-dev.github.io/holmesgpt/data-sources/
- For custom toolsets: https://robusta-dev.github.io/holmesgpt/data-sources/custom-toolsets/
- For remote MCP servers: https://robusta-dev.github.io/holmesgpt/data-sources/remote-mcp-servers/

If you need a toolset to access a system that you don't otherwise have access to, tell the user that you are missing an integration to access XYZ.
You should give an answer similar to "I don't have access to <system>. Please add a Holmes integration for <system> so that I can investigate this."
{%- endif -%}
When providing configuration guidance, always prefer the specific toolset documentation URL when available.
1 change: 1 addition & 0 deletions holmes/plugins/prompts/generic_ask.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Whenever possible you MUST first use tools to investigate then answer the questi
Do not say 'based on the tool output' or explicitly refer to tools at all.
If you output an answer and then realize you need to call more tools or there are possible next steps, you may do so by calling tools at that point in time.
If you have a good and concrete suggestion for how the user can fix something, tell them even if not asked explicitly
{% include '_current_date_time.jinja2' %}

Use conversation history to maintain continuity when appropriate, ensuring efficiency in your responses.

Comment thread
aantn marked this conversation as resolved.
Resolved
Expand Down
28 changes: 24 additions & 4 deletions holmes/plugins/runbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,27 @@ def load_runbook_catalog() -> Optional[RunbookCatalog]:
return None


def get_runbook_by_path(runbook_relative_path: str) -> str:
runbook_folder = os.path.dirname(os.path.realpath(__file__))
runbook_path = os.path.join(runbook_folder, runbook_relative_path)
return runbook_path
def get_runbook_by_path(
Comment thread
aantn marked this conversation as resolved.
Resolved
runbook_relative_path: str, search_paths: Optional[List[str]] = None
) -> Optional[str]:
"""
Find a runbook by searching through provided paths.

Args:
runbook_relative_path: The relative path to the runbook
search_paths: Optional list of directories to search. If None, uses default runbook folder.

Returns:
Full path to the runbook if found, None otherwise
"""
if search_paths is None:
# Default to the runbooks plugin directory
default_folder = os.path.dirname(os.path.realpath(__file__))
search_paths = [default_folder]

for search_path in search_paths:
runbook_path = os.path.join(search_path, runbook_relative_path)
if os.path.exists(runbook_path):
return runbook_path

return None
79 changes: 74 additions & 5 deletions holmes/plugins/toolsets/runbook/runbook_fetcher.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from typing import Any, Dict
import textwrap
from typing import Any, Dict, List, Optional

from holmes.core.tools import (
StructuredToolResult,
Expand All @@ -9,6 +10,8 @@
Toolset,
ToolsetTag,
)
from pathlib import Path

from holmes.plugins.runbooks import get_runbook_by_path


Expand All @@ -33,15 +36,75 @@ def __init__(self, toolset: "RunbookToolset"):
)

def _invoke(self, params: Any) -> StructuredToolResult:
path: str = params["link"]
link: str = params["link"]

# Build search paths list
search_paths = []

# Add additional search paths first if available
if self.toolset.config and "additional_search_paths" in self.toolset.config:
search_paths.extend(self.toolset.config["additional_search_paths"])

# Add default runbook folder
default_folder = Path(__file__).parent.parent.parent / "runbooks"
search_paths.append(str(default_folder))

# Find the runbook
runbook_path = get_runbook_by_path(link, search_paths)

runbook_path = get_runbook_by_path(path)
if runbook_path is None:
Comment thread
aantn marked this conversation as resolved.
Resolved
err_msg = (
f"Runbook '{link}' not found in any of the search paths: {search_paths}"
)
logging.error(err_msg)
return StructuredToolResult(
status=ToolResultStatus.ERROR,
error=err_msg,
params=params,
)

# Read and return the runbook content
try:
with open(runbook_path, "r") as file:
content = file.read()
wrapped_content = textwrap.dedent(f"""\
Comment thread
aantn marked this conversation as resolved.
Resolved
<runbook>
{textwrap.indent(content, " " * 20)}
</runbook>
Note: the above are DIRECTIONS not ACTUAL RESULTS. You now need to follow the steps outlined in the runbook yourself USING TOOLS.
Anything that looks like an actual result in the above <runbook> is just an EXAMPLE.
Now follow those steps and report back what you find.
You must follow them by CALLING TOOLS YOURSELF.
If you are missing tools, follow your general instructions on how to enable them as present in your system prompt.

Assuming the above runbook is relevant, you MUST start your response (after calling tools to investigate) with:
"I found a runbook named [runbook name/description] and used it to troubleshoot:"

Then list each step with ✅ for completed steps and ❌ for steps you couldn't complete.

<example>
I found a runbook named **Troubleshooting Erlang Issues** and used it to troubleshoot:

1. ✅ *Check BEAM VM memory usage* - 87% allocated (3.2GB used of 4GB limit)
2. ✅ *Review GC logs* - 15 full GC cycles in last 30 minutes, avg pause time 2.3s
3. ✅ *Verify Erlang application logs* - `** exception error: out of memory in process <0.139.0> called by gen_server:handle_msg/6`
4. ❌ *Could not analyze process mailbox sizes* - Observer tool not enabled in container. Enable remote shell or observer_cli for process introspection.
5. ✅ *Check pod memory limits* - container limit 4Gi, requests 2Gi
6. ✅ *Verify BEAM startup arguments* - `+S 4:4 +P 1048576`, no memory instrumentation flags enabled
7. ❌ *Could not retrieve APM traces* - Datadog traces toolset is disabled. You can enable it by following https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/datadog/
8. ❌ *Could not query Erlang metrics* - Prometheus integration is not connected. Enable it via https://robusta-dev.github.io/holmesgpt/data-sources/builtin-toolsets/prometheus/
9. ✅ *Examine recent deployments* - app version 2.1.3 deployed 4 hours ago, coincides with memory spike
10. ❌ *Could not check Stripe API status* - No toolset for Stripe integration exists. To monitor Stripe or similar third-party APIs, add a [custom toolset](https://robusta-dev.github.io/holmesgpt/data-sources/custom-toolsets/) or use a [remote MCP server](https://robusta-dev.github.io/holmesgpt/data-sources/remote-mcp-servers/)

**Root cause:** Memory leak in `gen_server` logic introduced in v2.1.3. BEAM VM hitting memory limit, causing out-of-memory crashes.

**Fix:** Roll back to v2.1.2 or increase memory limit to 6GB as a temporary workaround.
</example>
"
""")
return StructuredToolResult(
status=ToolResultStatus.SUCCESS,
data=content,
data=wrapped_content,
params=params,
)
except Exception as e:
Expand All @@ -59,7 +122,12 @@ def get_parameterized_one_liner(self, params) -> str:


class RunbookToolset(Toolset):
def __init__(self):
def __init__(self, additional_search_paths: Optional[List[str]] = None):
# Store additional search paths in config
config = {}
if additional_search_paths:
config["additional_search_paths"] = additional_search_paths

super().__init__(
name="runbook",
description="Fetch runbooks",
Expand All @@ -72,6 +140,7 @@ def __init__(self):
ToolsetTag.CORE,
],
is_default=True,
config=config,
)

def get_example_config(self) -> Dict[str, Any]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ user_prompt: "Is rabbitmq experiencing a split brain?"
expected_output:
- The link https://docs.robusta.dev/master/configuration/holmesgpt/toolsets/rabbitmq.html should be in the answer
tags:
- easy
# # this was working on an intermediate commit 266342caa5819a96ce0a91488a30ebe956d448eb on a feature branch
# it was broken by prompt changes on the next commit https://github.com/robusta-dev/holmesgpt/pull/729/commits/c09b94a240a18b0bf452b282e57554784f3789c4
# see braintrust for when it worked: https://www.braintrust.dev/app/robustadev/p/HolmesGPT/experiments/natanyellin-20250727_223957?c=&r=e0f844cb-5771-4468-b100-b231a99c4ab9&s=7b45406c-dc2d-4478-a8d0-beaf004c38b1
# we should be able to fix this with a bit more work
- medium
- transparency
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
containers:
- name: crasher
image: busybox
command: ["sh", "-c", "sleep 5; exit 1"]
command: ["sh", "-c", "sleep 1; exit 1"]
Comment thread
aantn marked this conversation as resolved.
Resolved
---
apiVersion: v1
kind: Pod
Expand All @@ -99,7 +99,7 @@ spec:
containers:
- name: crasher
image: busybox
command: ["sh", "-c", "sleep 3; exit 1"]
command: ["sh", "-c", "sleep 1; exit 1"]
---
apiVersion: v1
kind: Pod
Expand All @@ -111,7 +111,7 @@ spec:
containers:
- name: crasher
image: busybox
command: ["sh", "-c", "sleep 2; exit 1"]
command: ["sh", "-c", "sleep 1; exit 1"]
---
apiVersion: v1
kind: Pod
Expand All @@ -123,4 +123,4 @@ spec:
containers:
- name: crasher
image: busybox
command: ["sh", "-c", "sleep 4; exit 1"]
command: ["sh", "-c", "sleep 1; exit 1"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ expected_output:
- 6 pods in test-60 have restarted fewer than 3 times
before_test: |
kubectl apply -f manifests.yaml
sleep 90
sleep 120
after_test: |
kubectl delete -f manifests.yaml --ignore-not-found=true
tags:
Expand Down
Loading