Update start-openclaw.sh
Browse files- start-openclaw.sh +9 -12
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 |
{
|
|
@@ -136,24 +136,21 @@ echo "🔧 执行 openclaw doctor --fix ..."
|
|
| 136 |
openclaw doctor --fix || true
|
| 137 |
|
| 138 |
# ================================================
|
| 139 |
-
# 7. 强制微信独立
|
| 140 |
# ================================================
|
| 141 |
-
echo "🔧 强制微信
|
| 142 |
|
|
|
|
| 143 |
openclaw agents add wechat-agent --workspace /root/.openclaw/agents/wechat-agent --non-interactive || true
|
| 144 |
|
| 145 |
-
#
|
| 146 |
-
openclaw config set
|
| 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 |
-
#
|
| 154 |
-
openclaw
|
| 155 |
|
| 156 |
-
echo "✅
|
| 157 |
|
| 158 |
# ================================================
|
| 159 |
# 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. 生成基础配置文件
|
| 23 |
# ================================================
|
| 24 |
cat > /root/.openclaw/openclaw.json <<EOF
|
| 25 |
{
|
|
|
|
| 136 |
openclaw doctor --fix || true
|
| 137 |
|
| 138 |
# ================================================
|
| 139 |
+
# 7. 强制微信使用独立 Agent(当前最有效方式)
|
| 140 |
# ================================================
|
| 141 |
+
echo "🔧 强制设置微信使用独立 Agent (wechat-agent) ..."
|
| 142 |
|
| 143 |
+
# 创建独立 Agent
|
| 144 |
openclaw agents add wechat-agent --workspace /root/.openclaw/agents/wechat-agent --non-interactive || true
|
| 145 |
|
| 146 |
+
# 关键:把默认 Agent 改为 wechat-agent(这是目前最有效的做法)
|
| 147 |
+
openclaw config set agents.defaults.model.primary "nvidia/$MODEL" || true
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
openclaw config set channels.openclaw-weixin.defaultAgent "wechat-agent" || true
|
| 149 |
|
| 150 |
+
# 再执行一次 doctor 让配置生效
|
| 151 |
+
openclaw doctor --fix || true
|
| 152 |
|
| 153 |
+
echo "✅ 已强制设置 wechat-agent 为微信默认会话"
|
| 154 |
|
| 155 |
# ================================================
|
| 156 |
# 8. 启动定时备份
|