Skip to content

Commit 725d7fa

Browse files
szedan-rhclaude
andcommitted
fix: resolve monitoring page 500 errors
This commit fixes two issues causing 500 errors on the monitoring page: 1. Missing tools_db.json in ConfigMap - Added tools_db.json file to deploy/openshift/ directory - Updated deploy-to-openshift.sh to include tools_db.json in semantic-router-config ConfigMap - Fixes /api/tools-db endpoint returning 500 errors 2. Grafana login redirect conflict - Fixed /login route handler to distinguish between Grafana and Chat UI login requests - Checks for redirectTo query parameter containing "goto" to identify Grafana redirects - Routes Grafana login redirects to grafanaStaticProxy instead of chatUIProxy - Fixes 500 errors when Grafana redirects to /login with goto parameters Files modified: - deploy/openshift/tools_db.json (new) - deploy/openshift/deploy-to-openshift.sh - dashboard/backend/router/router.go 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 1a1297d commit 725d7fa

File tree

3 files changed

+151
-0
lines changed

3 files changed

+151
-0
lines changed

dashboard/backend/router/router.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ func Setup(cfg *config.Config) *http.ServeMux {
201201
if middleware.HandleCORSPreflight(w, r) {
202202
return
203203
}
204+
// Check if this is a Grafana login redirect by looking at the redirectTo parameter
205+
redirectTo := r.URL.Query().Get("redirectTo")
206+
if redirectTo != "" && strings.Contains(redirectTo, "goto") && grafanaStaticProxy != nil {
207+
log.Printf("Proxying Grafana login redirect: %s %s (redirectTo=%s)", r.Method, r.URL.Path, redirectTo)
208+
grafanaStaticProxy.ServeHTTP(w, r)
209+
return
210+
}
204211
log.Printf("Proxying Chat UI login: %s %s", r.Method, r.URL.Path)
205212
chatUIProxy.ServeHTTP(w, r)
206213
})

deploy/openshift/deploy-to-openshift.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ success "Dynamic config generated with IPs: Model-A=$MODEL_A_IP, Model-B=$MODEL_
204204
log "Creating ConfigMaps with dynamic IPs..."
205205
oc create configmap semantic-router-config \
206206
--from-file=config.yaml="$TEMP_CONFIG" \
207+
--from-file=tools_db.json="$SCRIPT_DIR/tools_db.json" \
207208
-n "$NAMESPACE" --dry-run=client -o yaml | oc apply -f -
208209

209210
oc create configmap envoy-config \

deploy/openshift/tools_db.json

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
[
2+
{
3+
"tool": {
4+
"type": "function",
5+
"function": {
6+
"name": "get_weather",
7+
"description": "Get current weather information for a location",
8+
"parameters": {
9+
"type": "object",
10+
"properties": {
11+
"location": {
12+
"type": "string",
13+
"description": "The city and state, e.g. San Francisco, CA"
14+
},
15+
"unit": {
16+
"type": "string",
17+
"enum": ["celsius", "fahrenheit"],
18+
"description": "Temperature unit"
19+
}
20+
},
21+
"required": ["location"]
22+
}
23+
}
24+
},
25+
"description": "Get current weather information, temperature, conditions, forecast for any location, city, or place. Check weather today, now, current conditions, temperature, rain, sun, cloudy, hot, cold, storm, snow",
26+
"category": "weather",
27+
"tags": ["weather", "temperature", "forecast", "climate"]
28+
},
29+
{
30+
"tool": {
31+
"type": "function",
32+
"function": {
33+
"name": "search_web",
34+
"description": "Search the web for information",
35+
"parameters": {
36+
"type": "object",
37+
"properties": {
38+
"query": {
39+
"type": "string",
40+
"description": "The search query"
41+
},
42+
"num_results": {
43+
"type": "integer",
44+
"description": "Number of results to return",
45+
"default": 5
46+
}
47+
},
48+
"required": ["query"]
49+
}
50+
}
51+
},
52+
"description": "Search the internet, web search, find information online, browse web content, lookup, research, google, find answers, discover, investigate",
53+
"category": "search",
54+
"tags": ["search", "web", "internet", "information", "browse"]
55+
},
56+
{
57+
"tool": {
58+
"type": "function",
59+
"function": {
60+
"name": "calculate",
61+
"description": "Perform mathematical calculations",
62+
"parameters": {
63+
"type": "object",
64+
"properties": {
65+
"expression": {
66+
"type": "string",
67+
"description": "Mathematical expression to evaluate"
68+
}
69+
},
70+
"required": ["expression"]
71+
}
72+
}
73+
},
74+
"description": "Calculate mathematical expressions, solve math problems, arithmetic operations, compute numbers, addition, subtraction, multiplication, division, equations, formula",
75+
"category": "math",
76+
"tags": ["math", "calculation", "arithmetic", "compute", "numbers"]
77+
},
78+
{
79+
"tool": {
80+
"type": "function",
81+
"function": {
82+
"name": "send_email",
83+
"description": "Send an email message",
84+
"parameters": {
85+
"type": "object",
86+
"properties": {
87+
"to": {
88+
"type": "string",
89+
"description": "Recipient email address"
90+
},
91+
"subject": {
92+
"type": "string",
93+
"description": "Email subject"
94+
},
95+
"body": {
96+
"type": "string",
97+
"description": "Email body content"
98+
}
99+
},
100+
"required": ["to", "subject", "body"]
101+
}
102+
}
103+
},
104+
"description": "Send email messages, email communication, contact people via email, mail, message, correspondence, notify, inform",
105+
"category": "communication",
106+
"tags": ["email", "send", "communication", "message", "contact"]
107+
},
108+
{
109+
"tool": {
110+
"type": "function",
111+
"function": {
112+
"name": "create_calendar_event",
113+
"description": "Create a new calendar event or appointment",
114+
"parameters": {
115+
"type": "object",
116+
"properties": {
117+
"title": {
118+
"type": "string",
119+
"description": "Event title"
120+
},
121+
"date": {
122+
"type": "string",
123+
"description": "Event date in YYYY-MM-DD format"
124+
},
125+
"time": {
126+
"type": "string",
127+
"description": "Event time in HH:MM format"
128+
},
129+
"duration": {
130+
"type": "integer",
131+
"description": "Duration in minutes"
132+
}
133+
},
134+
"required": ["title", "date", "time"]
135+
}
136+
}
137+
},
138+
"description": "Schedule meetings, create calendar events, set appointments, manage calendar, book time, plan meeting, organize schedule, reminder, agenda",
139+
"category": "productivity",
140+
"tags": ["calendar", "event", "meeting", "appointment", "schedule"]
141+
}
142+
]
143+

0 commit comments

Comments
 (0)