Skip to content

Commit afb7d63

Browse files
committed
update issue
Signed-off-by: Rohit Patil <ropatil@redhat.com>
1 parent 37b8e88 commit afb7d63

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pkg/promptsets/core/health_check.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ func initHealthCheckPrompts(o internalk8s.Openshift) []api.ServerPrompt {
3636

3737
func buildHealthCheckPromptMessages(verbose bool, namespace string) []api.PromptMessage {
3838
scopeMsg := "across all namespaces"
39-
namespaceFilter := ""
39+
podListInstruction := "- Use pods_list to get all pods"
40+
4041
if namespace != "" {
4142
scopeMsg = fmt.Sprintf("in namespace '%s'", namespace)
42-
namespaceFilter = fmt.Sprintf(" in namespace '%s'", namespace)
43+
podListInstruction = fmt.Sprintf("- Use pods_list_in_namespace with namespace parameter set to '%s' to get all pods in namespace '%s'", namespace, namespace)
4344
}
4445

4546
verboseMsg := ""
@@ -77,7 +78,7 @@ Follow these steps systematically:
7778
- Count total nodes and categorize issues
7879
7980
## 3. Check Pod Health
80-
- Use pods_list to get all pods%s
81+
%s
8182
- Identify problematic pods:
8283
* Phase = Failed or Pending (CRITICAL)
8384
* Container state waiting with reason:
@@ -161,7 +162,7 @@ Warnings: [count]
161162
- Be efficient: don't call the same tool multiple times unnecessarily
162163
- If a resource type doesn't exist (e.g., ClusterOperator on vanilla K8s), skip it gracefully
163164
- Provide clear, actionable insights in your summary
164-
- Use emojis for visual clarity: ✅ (healthy), ⚠️ (warning), ❌ (critical)`, scopeMsg, namespaceFilter, verboseMsg)
165+
- Use emojis for visual clarity: ✅ (healthy), ⚠️ (warning), ❌ (critical)`, scopeMsg, podListInstruction, verboseMsg)
165166

166167
assistantMessage := `I'll perform a comprehensive cluster health check following the systematic approach outlined. Let me start by gathering information about the cluster components.`
167168

pkg/promptsets/core/health_check_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ func TestBuildHealthCheckPromptMessages(t *testing.T) {
3939
// Check user message content
4040
userContent := messages[0].Content
4141
assert.Contains(t, userContent, "across all namespaces")
42-
assert.Contains(t, userContent, "pods_list")
42+
assert.Contains(t, userContent, "Use pods_list to get all pods")
4343
assert.Contains(t, userContent, "resources_list")
4444
assert.Contains(t, userContent, "events_list")
45-
assert.NotContains(t, userContent, "pods_list_in_all_namespaces")
45+
assert.NotContains(t, userContent, "pods_list_in_namespace")
4646

4747
// Check assistant message
4848
assert.Contains(t, messages[1].Content, "comprehensive cluster health check")
@@ -58,6 +58,8 @@ func TestBuildHealthCheckPromptMessages(t *testing.T) {
5858
userContent := messages[0].Content
5959
assert.Contains(t, userContent, "in namespace 'test-namespace'")
6060
assert.NotContains(t, userContent, "across all namespaces")
61+
assert.Contains(t, userContent, "Use pods_list_in_namespace with namespace parameter set to 'test-namespace'")
62+
assert.NotContains(t, userContent, "Use pods_list to get all pods")
6163
})
6264

6365
t.Run("Messages with verbose mode", func(t *testing.T) {

0 commit comments

Comments
 (0)