Update start-openclaw.sh
Browse files- start-openclaw.sh +19 -9
start-openclaw.sh
CHANGED
|
@@ -19,7 +19,7 @@ echo "✅ 目录创建完成"
|
|
| 19 |
CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g")
|
| 20 |
|
| 21 |
# ================================================
|
| 22 |
-
# 3. 生成基础配置文件
|
| 23 |
# ================================================
|
| 24 |
cat > /root/.openclaw/openclaw.json <<EOF
|
| 25 |
{
|
|
@@ -40,6 +40,9 @@ cat > /root/.openclaw/openclaw.json <<EOF
|
|
| 40 |
"model": { "primary": "nvidia/$MODEL" }
|
| 41 |
}
|
| 42 |
},
|
|
|
|
|
|
|
|
|
|
| 43 |
"commands": {
|
| 44 |
"restart": true
|
| 45 |
},
|
|
@@ -67,7 +70,7 @@ echo "✅ 基础配置文件生成完成"
|
|
| 67 |
python3 /app/sync.py restore
|
| 68 |
|
| 69 |
# ================================================
|
| 70 |
-
# 5. 微信插件激活
|
| 71 |
# ================================================
|
| 72 |
echo "🔄 微信 ClawBot 激活流程..."
|
| 73 |
|
|
@@ -100,6 +103,9 @@ else
|
|
| 100 |
"model": { "primary": "nvidia/$MODEL" }
|
| 101 |
}
|
| 102 |
},
|
|
|
|
|
|
|
|
|
|
| 103 |
"commands": {
|
| 104 |
"restart": true
|
| 105 |
},
|
|
@@ -130,20 +136,24 @@ echo "🔧 执行 openclaw doctor --fix ..."
|
|
| 130 |
openclaw doctor --fix || true
|
| 131 |
|
| 132 |
# ================================================
|
| 133 |
-
# 7.
|
| 134 |
# ================================================
|
| 135 |
-
echo "🔧
|
| 136 |
|
| 137 |
-
# 创建独立 Agent
|
| 138 |
openclaw agents add wechat-agent --workspace /root/.openclaw/agents/wechat-agent --non-interactive || true
|
| 139 |
|
| 140 |
-
# 强
|
| 141 |
-
openclaw config set --json bindings '[
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
-
# 额外保险配置
|
| 144 |
openclaw config set channels.openclaw-weixin.defaultAgent "wechat-agent" || true
|
| 145 |
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
# ================================================
|
| 149 |
# 8. 启动定时备份
|
|
|
|
| 19 |
CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g")
|
| 20 |
|
| 21 |
# ================================================
|
| 22 |
+
# 3. 生成基础配置文件(增加 plugins.allow)
|
| 23 |
# ================================================
|
| 24 |
cat > /root/.openclaw/openclaw.json <<EOF
|
| 25 |
{
|
|
|
|
| 40 |
"model": { "primary": "nvidia/$MODEL" }
|
| 41 |
}
|
| 42 |
},
|
| 43 |
+
"plugins": {
|
| 44 |
+
"allow": ["openclaw-weixin"]
|
| 45 |
+
},
|
| 46 |
"commands": {
|
| 47 |
"restart": true
|
| 48 |
},
|
|
|
|
| 70 |
python3 /app/sync.py restore
|
| 71 |
|
| 72 |
# ================================================
|
| 73 |
+
# 5. 微信插件激活
|
| 74 |
# ================================================
|
| 75 |
echo "🔄 微信 ClawBot 激活流程..."
|
| 76 |
|
|
|
|
| 103 |
"model": { "primary": "nvidia/$MODEL" }
|
| 104 |
}
|
| 105 |
},
|
| 106 |
+
"plugins": {
|
| 107 |
+
"allow": ["openclaw-weixin"]
|
| 108 |
+
},
|
| 109 |
"commands": {
|
| 110 |
"restart": true
|
| 111 |
},
|
|
|
|
| 136 |
openclaw doctor --fix || true
|
| 137 |
|
| 138 |
# ================================================
|
| 139 |
+
# 7. 强制微信独立会话绑定(最强版本)
|
| 140 |
# ================================================
|
| 141 |
+
echo "🔧 强制微信消息走独立 Agent (wechat-agent) ..."
|
| 142 |
|
|
|
|
| 143 |
openclaw agents add wechat-agent --workspace /root/.openclaw/agents/wechat-agent --non-interactive || true
|
| 144 |
|
| 145 |
+
# 最强路由规则:任何来自 openclaw-weixin 的消息都强制使用 wechat-agent
|
| 146 |
+
openclaw config set --json bindings '[
|
| 147 |
+
{"agentId": "wechat-agent", "match": {"channel": "openclaw-weixin"}},
|
| 148 |
+
{"agentId": "wechat-agent", "match": {"channelId": "openclaw-weixin"}}
|
| 149 |
+
]' || true
|
| 150 |
|
|
|
|
| 151 |
openclaw config set channels.openclaw-weixin.defaultAgent "wechat-agent" || true
|
| 152 |
|
| 153 |
+
# 禁用 main agent 处理微信消息(重要)
|
| 154 |
+
openclaw config set agents.main.enabled false || true
|
| 155 |
+
|
| 156 |
+
echo "✅ 微信独立会话绑定已强制设置"
|
| 157 |
|
| 158 |
# ================================================
|
| 159 |
# 8. 启动定时备份
|