OpenClaw Relay
當工作符合以下情況時使用此技能:
- 「與 Molty 對話」
- 「將此中繼到 OpenClaw 頻道工作階段」
- 「使用 acpx」
- 「透過 acp 經由閘道發送此訊息」
- 「透過 SSH 在遠端 OpenClaw 橋接上工作」
單一技能,兩種傳輸方式:
localssh
預設使用 local,可從目前的 OpenClaw 簽出目錄進行直接的電話遊戲式工作。當目標代理程式/工作階段位於另一台機器上時,使用 ssh。
對於 Peter 的設定,Molty 通常位於 Mac Studio 閘道上,可透過 [email protected] 存取;避免為了一次性的中繼工作使用 mac-studio SSH 別名,因為該別名會自動附加 tmux。
腳本路徑:scripts/openclaw_relay.py
目標別名檔案:config/session_aliases.json
模式選擇
當以下情況時選擇 local:
- 使用者明確指定
acpx - 目標工作階段位於目前機器上
- 目標是快速中繼或私人詢問
當以下情況時選擇 ssh:
- 目標代理程式/工作階段位於另一台主機上
- 您想要一個持久的橋接工作階段
- 您需要在遠端機器上進行非同步佇列/等待/顯示流程
預設值
該腳本避免使用內嵌的個人路徑。必要時可使用環境變數或旗標覆寫。
- 傳輸方式:
local - 本地 repo 工作目錄:目前工作目錄
- 本地 acpx 儲存庫:
<cwd>/extensions/acpx - ssh 主機:
[email protected] - 遠端 repo 工作目錄:
<remote-home>/clawdbot - 遠端 acpx 儲存庫:
<remote-home>/Projects/oss/acpx - 閘道金鑰檔案:
<home>/.openclaw/gateway.token - 控制工作階段名稱:
codex-bridge - 目標別名檔案:
config/session_aliases.json
有用的環境變數:
OPENCLAW_RELAY_TRANSPORTOPENCLAW_RELAY_HOSTOPENCLAW_RELAY_CWDOPENCLAW_RELAY_ACPX_REPOOPENCLAW_RELAY_GATEWAY_URLOPENCLAW_RELAY_GATEWAY_TOKEN_FILEOPENCLAW_RELAY_SESSIONOPENCLAW_RELAY_TARGETS_FILE
快速開始
健康檢查:
python3 scripts/openclaw_relay.py doctor
列出已知的目標別名:
python3 scripts/openclaw_relay.py targets
解析目標別名:
python3 scripts/openclaw_relay.py resolve --target maintainers
私下向目標工作階段提問:
python3 scripts/openclaw_relay.py ask \
--target maintainers \
--message "Summarize the current vibe in this channel."
強制將文字發送到已解析的目標:
python3 scripts/openclaw_relay.py force-send \
--target maintainers \
--text "Deploy is done."
對於多行貼文,請使用 --text-file <path> 或 --text-file -,而不是
在 shell 中引用訊息。
當使用者明確想要頻道貼文時強制發送媒體:
python3 scripts/openclaw_relay.py force-send \
--transport ssh \
--host [email protected] \
--target maintainers \
--text "Demo video." \
--media /tmp/demo.mp4
使用持久控制工作階段:
python3 scripts/openclaw_relay.py ensure
python3 scripts/openclaw_relay.py send --message "Reply with exactly OK."
python3 scripts/openclaw_relay.py show
遠端主機範例:
python3 scripts/openclaw_relay.py doctor --transport ssh --host [email protected]
python3 scripts/openclaw_relay.py send \
--transport ssh \
--host [email protected] \
--message "Reply with exactly OK."
非同步工作流程
將工作排入佇列並輪詢相同的控制工作階段:
python3 scripts/openclaw_relay.py start --message "Work on X and reply when done."
python3 scripts/openclaw_relay.py wait --after-seq <last-seq>
python3 scripts/openclaw_relay.py show
目標別名
config/session_aliases.json 附帶預留位置。請為您的設定替換為實際值。
範例結構:
{
"main": "agent:<agentId>:main",
"maintainers": "agent:<agentId>:discord:channel:<channelId>"
}
工作階段規則
選擇指令時請使用這些規則:
- 想要從特定工作階段獲得私人回覆:
ask - 想要目標工作階段決定是否發文:
publish - 想要保證直接發文:
force-send - 想要與控制大腦進行阻塞式連續通訊:
send - 想要發送後即忘的非同步操作:
start,然後wait和show - 想要停止排隊的工作:
cancel
故障處理
如果中繼工作失敗:
- 執行
doctor。 - 執行
status。 - 執行
show。 - 如果控制工作階段卡住,執行
cancel,然後ensure,再重試。
如果路由發現不確定:
- 先解析目標。
- 偏好使用別名或精確的工作階段金鑰。
- 在發送實際負載之前,先使用一個小型的探測詢問。
輸出中繼
回傳實際的助理文字或傳遞結果,而非 shell 噪音。
對於中繼任務,請回報:
- 使用的傳輸方式
- 目標工作階段金鑰
- 路由探測/解析是否成功
- 最終發文或回傳的結果