sharween commited on
Commit
96b5600
·
verified ·
1 Parent(s): c65aeea

Update start-openclaw.sh

Browse files
Files changed (1) hide show
  1. 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. 生成基础配置文件(增加 plugins.allow)
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 "🔧 强制微信消息走独立 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. 启动定时备份
 
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. 启动定时备份