BUG: SESSIONS_DIR hardcoded, cannot customize path #3

Closed
opened 2026-02-28 17:09:15 -06:00 by SpeedyFoxAi · 1 comment
Owner

Problem

SESSIONS_DIR is hardcoded to /root/.openclaw/agents/main/sessions.

Users cannot customize the sessions directory without modifying source code.

Impact

  • Non-standard OpenClaw installations cannot use the watcher
  • Requires source modification for different environments

Root Cause

Hardcoded path in realtime_qdrant_watcher.py:

SESSIONS_DIR = Path("/root/.openclaw/agents/main/sessions")

Solution

Changed to read from environment variable with fallback:

SESSIONS_DIR = Path(os.getenv("OPENCLAW_SESSIONS_DIR", "/root/.openclaw/agents/main/sessions"))

Fix Version

v1.1 - Commit a053ec1

Usage

Set environment variable before running watcher:

export OPENCLAW_SESSIONS_DIR=/custom/path/to/sessions
python3 realtime_qdrant_watcher.py
## Problem `SESSIONS_DIR` is hardcoded to `/root/.openclaw/agents/main/sessions`. Users cannot customize the sessions directory without modifying source code. ## Impact - Non-standard OpenClaw installations cannot use the watcher - Requires source modification for different environments ## Root Cause Hardcoded path in `realtime_qdrant_watcher.py`: ```python SESSIONS_DIR = Path("/root/.openclaw/agents/main/sessions") ``` ## Solution Changed to read from environment variable with fallback: ```python SESSIONS_DIR = Path(os.getenv("OPENCLAW_SESSIONS_DIR", "/root/.openclaw/agents/main/sessions")) ``` ## Fix Version v1.1 - Commit a053ec1 ## Usage Set environment variable before running watcher: ```bash export OPENCLAW_SESSIONS_DIR=/custom/path/to/sessions python3 realtime_qdrant_watcher.py ```
Author
Owner

FIX IMPLEMENTED AND PUSHED

Commit: a053ec1 - fix: SESSIONS_DIR env var and config dimension docs

Detailed Fix Steps:

Code Change

In watcher/realtime_qdrant_watcher.py:

Before:

SESSIONS_DIR = Path("/root/.openclaw/agents/main/sessions")

After:

SESSIONS_DIR = Path(os.getenv("OPENCLAW_SESSIONS_DIR", "/root/.openclaw/agents/main/sessions"))

Usage

# Default path (no env var set)
python3 realtime_qdrant_watcher.py

# Custom path
export OPENCLAW_SESSIONS_DIR=/custom/path/to/sessions
python3 realtime_qdrant_watcher.py

Validation

  • Tested with no env var: uses default path
  • Tested with custom env var: uses custom path
  • Syntax validated 4x

Closing as fixed in v1.1

**FIX IMPLEMENTED AND PUSHED** ✅ Commit: `a053ec1` - fix: SESSIONS_DIR env var and config dimension docs ## Detailed Fix Steps: ### Code Change In `watcher/realtime_qdrant_watcher.py`: **Before:** ```python SESSIONS_DIR = Path("/root/.openclaw/agents/main/sessions") ``` **After:** ```python SESSIONS_DIR = Path(os.getenv("OPENCLAW_SESSIONS_DIR", "/root/.openclaw/agents/main/sessions")) ``` ### Usage ```bash # Default path (no env var set) python3 realtime_qdrant_watcher.py # Custom path export OPENCLAW_SESSIONS_DIR=/custom/path/to/sessions python3 realtime_qdrant_watcher.py ``` ### Validation - Tested with no env var: uses default path ✅ - Tested with custom env var: uses custom path ✅ - Syntax validated 4x **Closing as fixed in v1.1**
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SpeedyFoxAi/jarvis-memory#3