Skip to content

setup.sh 平台检测不健壮,在多 Bot 环境下失效 #48

@nnn228085-star

Description

@nnn228085-star

setup.sh 第 42 行

detect_platform() {
if [ -d "$HOME/.openclaw" ]; then
SKILLS_DIR="$HOME/.openclaw/skills/agentguard"
PLATFORM="openclaw-managed"
...
}


**问题描述**:
`setup.sh` 通过检测 `~/.openclaw/` 目录来判断平台。当环境中存在多个 Bot 的隔离目录(如 `~/.openclaw-minax/`),同时又有一个旧的只读 `~/.openclaw/` 共享配置目录时,setup 会优先匹配到只读目录,导致安装失败,agent 无法加载 skill。

此外,`setup.sh` 完全没有"安装到某个 agent 私有 skill 池"的概念,而这在现代多 agent 平台中是常见模式。

**建议修复方案**:
1. 增加 `--target <path>` 参数,支持显式指定安装目录
2. 检测目录时验证是否可写(`[ -w "$dir" ]`)
3. 当多个候选目录匹配 `~/.openclaw*/` 时,列出候选项让用户选择
4. 增加 `--scope user|project|agent <name>` 参数,支持 per-agent skill 安装

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions