Skip to content

Commit f8a1638

Browse files
committed
prompts
1 parent 7189d74 commit f8a1638

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

bugzooka/analysis/prompts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
- No emojis in tables
111111
- Separate each config section with 80 equals signs.
112112
113-
**Remember:**
113+
**Remember:**
114114
- The tools provide percentage changes - use them as provided
115115
- CHECK thresholds (5% and 10%) before categorizing
116116
- SORT by absolute percentage change (highest first) - this is mandatory
@@ -129,7 +129,7 @@
129129
}
130130
# Jira tool prompt - used when Jira MCP tools are available
131131
JIRA_TOOL_PROMPT = {
132-
"system_suffix": (
132+
"system": (
133133
"\n\nIMPORTANT: You have access to JIRA search tools. After analyzing the error, "
134134
"ALWAYS search for related issues in JIRA using the search_jira_issues tool with the OCPBUGS project. "
135135
"Extract key error terms, component names, or operators from the log summary to search for similar issues. "

bugzooka/integrations/gemini_client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
INFERENCE_MAX_TOOL_ITERATIONS,
1313
)
1414
from bugzooka.integrations.inference import InferenceAPIUnavailableError
15+
from bugzooka.analysis.prompts import JIRA_TOOL_PROMPT
1516

1617

1718
logger = logging.getLogger(__name__)
@@ -364,8 +365,14 @@ async def analyze_log_with_gemini(
364365
error_summary[:150] + "..." if len(error_summary) > 150 else error_summary,
365366
)
366367

368+
# Append Jira prompt if Jira MCP tools are available
369+
system_prompt = prompt_config["system"]
370+
if tools and any(getattr(t, "name", "") == "search_jira_issues" for t in tools):
371+
logger.info("Jira MCP tools detected - injecting Jira prompt")
372+
system_prompt += JIRA_TOOL_PROMPT["system"]
373+
367374
messages = [
368-
{"role": "system", "content": prompt_config["system"]},
375+
{"role": "system", "content": system_prompt},
369376
{"role": "user", "content": formatted_content},
370377
{"role": "assistant", "content": prompt_config["assistant"]},
371378
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
app.kubernetes.io/instance: jira-mcp
6+
name: jira-mcp
7+
namespace: ${BUGZOOKA_NAMESPACE}
8+
spec:
9+
ports:
10+
- name: http
11+
port: 3031
12+
protocol: TCP
13+
targetPort: 3031
14+
selector:
15+
app.kubernetes.io/instance: jira-mcp
16+
app.kubernetes.io/name: jira-mcp
17+
type: ClusterIP

0 commit comments

Comments
 (0)