Skip to content

Commit dbf7397

Browse files
author
Paul C
committed
fix: AI incorrectly using local exec for remote nodes + KB download
1. AI system prompt now clearly states [EXEC] ALWAYS runs locally and when asking about a specific remote node, [EXEC_ALL] must be used. Also clarifies Proxmox nodes cannot be exec'd into — use metrics. 2. setup.sh now downloads the AI knowledge base from GitHub when installing from prebuilt binary (previously only worked from source).
1 parent ce73de7 commit dbf7397

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

setup.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,19 @@ fi
986986
echo "✓ wolfstack installed to /usr/local/bin/wolfstack"
987987

988988
# ─── Install AI knowledge base ──────────────────────────────────────────────
989-
if [ -d "$INSTALL_DIR/knowledge" ]; then
990-
mkdir -p /etc/wolfstack/knowledge
989+
mkdir -p /etc/wolfstack/knowledge
990+
if [ -d "$INSTALL_DIR/knowledge" ] && ls "$INSTALL_DIR/knowledge/"*.md >/dev/null 2>&1; then
991991
cp "$INSTALL_DIR/knowledge/"*.md /etc/wolfstack/knowledge/ 2>/dev/null || true
992-
echo "✓ AI knowledge base installed"
992+
echo "✓ AI knowledge base installed (from source)"
993+
else
994+
# Download knowledge base from GitHub (for prebuilt binary installs)
995+
echo " Downloading AI knowledge base..."
996+
KB_URL="https://raw.githubusercontent.com/wolfsoftwaresystemsltd/WolfStack/${CHANNEL:-master}/knowledge/wolfstack-kb.md"
997+
if curl -fsSL --connect-timeout 10 -o /etc/wolfstack/knowledge/wolfstack-kb.md "$KB_URL" 2>/dev/null; then
998+
echo "✓ AI knowledge base installed"
999+
else
1000+
echo " ⚠ Could not download AI knowledge base (non-critical)"
1001+
fi
9931002
fi
9941003

9951004
# ─── Install web UI ─────────────────────────────────────────────────────────

src/ai/mod.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,17 +1370,19 @@ fn build_system_prompt(knowledge: &str, server_context: &str) -> String {
13701370
- **Run read-only commands** on this server and across the WolfStack cluster\n\n\
13711371
## Command Execution\n\
13721372
You can run commands on the server by using these special tags:\n\
1373-
- `[EXEC]command[/EXEC]` — runs the command on this server only\n\
1374-
- `[EXEC_ALL]command[/EXEC_ALL]` — runs the command on ALL WolfStack servers in the cluster\n\n\
1375-
**Rules:**\n\
1373+
- `[EXEC]command[/EXEC]` — runs the command on the LOCAL WolfStack node only (the machine running this dashboard)\n\
1374+
- `[EXEC_ALL]command[/EXEC_ALL]` — runs the command on ALL WolfStack nodes in the cluster. Results come back labelled by hostname.\n\n\
1375+
**CRITICAL RULES:**\n\
1376+
- [EXEC] ALWAYS runs on the LOCAL node — even if the user is viewing a different node in the dashboard\n\
1377+
- When the user asks about a SPECIFIC REMOTE node (e.g. 'what is using CPU on pbs?'), you MUST use [EXEC_ALL] and then look at the results for that specific hostname in the output\n\
1378+
- Do NOT use [EXEC] when the user asks about a remote node — [EXEC] cannot reach remote nodes\n\
13761379
- Only read-only commands are allowed (ls, cat, lscpu, df, ps, docker ps, systemctl status, etc.)\n\
13771380
- Destructive commands (rm, kill, reboot, etc.) are blocked and will fail\n\
1378-
- Use [EXEC_ALL] when the user asks about the cluster or all servers\n\
1379-
- Use [EXEC] when the user asks about this specific server\n\
13801381
- You MUST use these tags when the user asks a question that requires live data\n\
13811382
- Do NOT just tell the user how to run a command — run it yourself and present the results\n\
13821383
- After receiving command output, summarize the results clearly for the user\n\
1383-
- Keep commands simple and focused\n\n\
1384+
- Keep commands simple and focused\n\
1385+
- When showing results from [EXEC_ALL], clearly label which node each result came from\n\n\
13841386
## Cluster Topology\n\
13851387
- All WolfStack nodes are **equal peers** — do NOT label any node as 'main', 'primary', or 'secondary'\n\
13861388
- Each node runs whatever Wolf components it needs; not all nodes run the same services\n\
@@ -1389,7 +1391,8 @@ fn build_system_prompt(knowledge: &str, server_context: &str) -> String {
13891391
## Proxmox Nodes\n\
13901392
- Proxmox nodes are **monitored but not managed** — you can see their metrics, VM/CT counts, and status\n\
13911393
- You CANNOT execute commands on Proxmox nodes (they don't run WolfStack agents)\n\
1392-
- Proxmox data is shown in the server state below; use it to answer questions about the infrastructure\n\
1394+
- For Proxmox node issues (high CPU, high memory), use the metrics data provided below — you cannot SSH or exec into them\n\
1395+
- When a user asks about a Proxmox node, answer from the metrics/VM/CT data, and explain you cannot run commands on it\n\
13931396
- When reporting on the full infrastructure, include Proxmox node health data (CPU, RAM, disk)\n\n\
13941397
## Proposed Actions (Fix It)\n\
13951398
When you identify a problem and know how to fix it, propose the fix using ACTION tags.\n\

0 commit comments

Comments
 (0)