fix(qqbot): support QQBOT_DATA_DIR environment variable#80248
Conversation
…' for normal no-memory cases
…ta directory Respects QQBOT_DATA_DIR env var for QQBot data and media paths, falling back to ~/.openclaw/qqbot. Fixes openclaw#39461
…ta directory Respects QQBOT_DATA_DIR env var for QQBot data and media paths, falling back to ~/.openclaw/qqbot. Fixes openclaw#39461
…ta directory Respects QQBOT_DATA_DIR env var for QQBot data and media paths, falling back to ~/.openclaw/qqbot. Fixes openclaw#39461
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate/superseded: this branch does not implement the stated QQBot data-dir fix, only carries an unrelated Active Memory hunk that is already on current main, while the actual QQBOT_DATA_DIR work is tracked in an open canonical PR. So I’m closing this here and keeping the remaining discussion on the canonical linked item. Review detailsBest possible solution: Keep this wrong branch closed and review a corrected QQBot-owned helper fix through #78253 or an equivalent replacement. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence path: set QQBOT_DATA_DIR, then current-main QQBot data helpers still resolve under getHomeDir()/.openclaw/qqbot. Is this the best way to solve the issue? No. Centralizing the override in the QQBot helper is the right direction, but this PR does not touch QQBot and is superseded by the open canonical QQBot PR. Security review: Security review cleared: The submitted diff only changes an Active Memory status string and does not alter dependencies, workflows, secrets handling, or storage permissions. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against afe26f51a3f8. |
Summary
Respects
QQBOT_DATA_DIRenvironment variable for QQBot data and media paths, with fallback to~/.openclaw/qqbot.Changes
getQQBotDataBaseDir()helper that checksprocess.env.QQBOT_DATA_DIRgetQQBotDataPath(),getQQBotDataDir(),getQQBotMediaPath(),getQQBotMediaDir()to use the new helpernormalizePath()for tilde expansion and path normalizationEdge Cases Handled
QQBOT_DATA_DIRnot set → falls back to~/.openclaw/qqbotQQBOT_DATA_DIRcontains~→ expanded vianormalizePath()QQBOT_DATA_DIRcontains trailing slash → normalized viapath.join()QQBOT_DATA_DIR→ treated as unset (falsy check)Test Plan
getQQBotDataDir()returns custom path when env var set~/.openclaw/qqbotwhen env var unsetFixes #39461