From 13717f16e5470961eafa475e0418ba346332ccfe Mon Sep 17 00:00:00 2001 From: Nova AI Date: Fri, 13 Feb 2026 14:51:09 +0000 Subject: [PATCH] Fix hard-coded paths in launch_rag_agent.sh (v1.0.4) - Replaced /home/william/.openclaw/workspace/rag with dynamic path - Replaced /home/william/.local/bin/openclaw with PATH resolution - Script now portable across different user environments - Addresses security scan findings from clawhub.com --- CHANGELOG.md | 16 ++++++++++++++++ launch_rag_agent.sh | 17 ++++++++++++++--- package.json | 2 +- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eca842e..83fce71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,6 +97,22 @@ All notable changes to the OpenClaw RAG Knowledge System will be documented in t --- +## [1.0.4] - 2026-02-13 + +### Fixed +- **Hard-coded paths in launch_rag_agent.sh**: Fixed missing portability update from v1.0.3 + - Replaced `/home/william/.openclaw/workspace/rag` with `os.path.expanduser("~/.openclaw/workspace/rag")` + - Replaced `/home/william/.local/bin/openclaw` with dynamic PATH resolution + - Now checks for `openclaw` in PATH first, then falls back to `~/.local/bin/openclaw` + - Proper error message if openclaw not found + +### Security +- Removed all user-specific hard-coded paths from launch_rag_agent.sh +- Verified portability across different user environments +- Script now installs correctly in OpenClaw skill packages for any user + +--- + ## [Unreleased] ### Planned diff --git a/launch_rag_agent.sh b/launch_rag_agent.sh index ecdafd5..4e1f93f 100644 --- a/launch_rag_agent.sh +++ b/launch_rag_agent.sh @@ -1,12 +1,15 @@ #!/bin/bash # RAG Agent Launcher - Spawns an agent with automatic knowledge base access - +# # This spawns a sub-agent that has RAG automatically integrated # The agent will query your knowledge base before responding to questions +# Dynamic path resolution for portability +RAG_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SESSION_SPAWN_COMMAND='python3 -c " import sys -sys.path.insert(0, \"/home/william/.openclaw/workspace/rag\") +import os +sys.path.insert(0, os.path.expanduser(\"~/.openclaw/workspace/rag\")) # Add RAG context to system prompt ORIGINAL_TASK=\"$@\" @@ -40,4 +43,12 @@ Use the context above if relevant to help answer the question.\" \"\")" # Spawn the agent with RAG context -/home/william/.local/bin/openclaw sessions spawn "$SESSION_SPAWN_COMMAND" \ No newline at end of file +# Use 'openclaw' from PATH if available, fallback to local installation +if command -v openclaw >/dev/null 2>&1; then + openclaw sessions spawn "$SESSION_SPAWN_COMMAND" +elif [ -f "$HOME/.local/bin/openclaw" ]; then + "$HOME/.local/bin/openclaw" sessions spawn "$SESSION_SPAWN_COMMAND" +else + echo "Error: openclaw command not found in PATH or ~/.local/bin/" >&2 + exit 1 +fi \ No newline at end of file diff --git a/package.json b/package.json index d54a9c7..80f6e61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rag-openclaw", - "version": "1.0.3", + "version": "1.0.4", "description": "RAG Knowledge System for OpenClaw - Semantic search across chat history, code, docs, and skills with automatic memory retrieval", "homepage": "http://git.theta42.com/nova/openclaw-rag-skill", "author": {