Skip to content

[Bug]:路径错误 #39461

Description

@jiahao-0111

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Bug: QQBot 插件未读取 QQBOT_DATA_DIR 环境变量

问题描述

设置 QQBOT_DATA_DIR 环境变量后,QQBot 插件仍使用中文路径 C:\Users\张家豪\.openclaw\qqbot,导致警告提示。

环境

  • 操作系统: Windows 10
  • OpenClaw 版本: 2026.3.2
  • Node 版本: v24.14.0

复现步骤

  1. 设置环境变量 QQBOT_DATA_DIR=D:\qqbot
  2. 重启 OpenClaw Gateway
  3. 查看环境诊断,仍显示 数据目录: C:\Users\张家豪\.openclaw\qqbot

预期行为

应该读取 QQBOT_DATA_DIR 环境变量,使用设置的路径作为数据目录。

根因

文件 extensions/qqbot/src/utils/platform.ts 中的 getQQBotDataDir 函数未读取 QQBOT_DATA_DIR 环境变量:

export function getQQBotDataDir(...subPaths: string[]): string {
  const dir = path.join(getHomeDir(), ".openclaw", "qqbot", ...subPaths);
  // 缺少读取 QQBOT_DATA_DIR 的逻辑
}

建议修复

getQQBotDataDir 函数中添加对 QQBOT_DATA_DIR 环境变量的支持。

Steps to reproduce

0

Expected behavior

0

Actual behavior

0

OpenClaw version

2026.3.2

Operating system

Windows11

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions