🏗️ OpenClaw Dual-Mac Architecture

Skillsauce Infrastructure — Updated 2026-03-15

☁️ CLOUDFLARE EDGE *.skillsauce.tech · walkquest.pages.dev · awsth-medical.pages.dev DNS + Tunnel + Pages + Access + Turnstile CF Tunnel 👤 Minn (พี่หมิน) WhatsApp · Telegram 🖥️ iMac — Command Center macOS 12.7.6 · x64 · TS: 100.73.43.19 OpenClaw Gateway :18789 · loopback cloudflared Tunnel 84f74b1b Dashboard :8800 · HTTP 🤖 Agent Team First COO — orchestrator Opus 4.6 ⏰ 1h Pae เลขา AWSWORK MiniMax M2.5 ⏰ 1h Chief CTO — infra/deploy MiniMax M2.5 ⏰ 4h Vault CFO — finance MiniMax M2.5 ⏰ 6h CDO Chief Data — analytics MiniMax M2.5 ⏰ 4h Guard Security — scans MiniMax M2.5 ⏰ 2h 🔑 Auth (9 keys) Anthropic · MiniMax OpenAI · Google DeepSeek · Moonshot 📱 Channels WhatsApp · Telegram 🔒 Tailscale VPN 💻 M4 MacBook Air — Compute Worker macOS 26.3 · ARM64 OpenClaw Gateway :18789 · bind=lan Claude Office + Codex :3001 · Docker · 5 workers 🔑 Auth (1 key) minimax-portal only Ollama · Python 3.14 qwen2.5:14b · Kiro CF Tunnel Routes dashboard.skillsauce.tech → iMac:8800 console.skillsauce.tech → iMac:8800 control.skillsauce.tech → iMac:18789 office.skillsauce.tech → M4:3001 m4.skillsauce.tech → M4:18789 campus.skillsauce.tech → M4:3002 studio.skillsauce.tech → M4:19000 CF Pages (Serverless) walkquest.pages.dev awsth-medical.pages.dev

📚 Lessons Learned

🔴 Provider Name Mismatch
Config ใช้ minimax/MiniMax-M2.5 แต่ auth key เก็บเป็น minimax-portal:default — ชื่อต้องตรงกัน 100%
🔴 Gateway + Node Port Conflict
M4 รัน gateway (:18789) + SSH tunnel node (:18789) พร้อมกัน → ชนกัน ต้องเลือกอย่างใดอย่างหนึ่ง
🔴 Token Mismatch
Node service ใช้ token คนละตัวกับ gateway.auth.token → unauthorized error loop
🟡 Auth Fragmentation
iMac มี 9 API keys, M4 มีแค่ 1 — ถ้า M4 ต้องเรียก model อื่น จะ fail เงียบ
🟡 Agent Config Drift
เปลี่ยน policy (Sonnet → MiniMax) แต่ openclaw.json ยังเป็นค่าเก่า — ต้อง update ทุก agent

🚀 What Can Be Better

Priority: HIGH
Centralized Auth
Sync auth-profiles.json จาก iMac → M4 อัตโนมัติ หรือใช้ node pairing ให้ auth ไหลผ่าน primary gateway
Priority: HIGH
Clear Machine Roles
iMac = Command Center (agents + channels + tunnel) · M4 = Pure Compute (Docker, Codex, builds) ไม่ต้องมี gateway เอง
Priority: MEDIUM
Native Node Pairing
ใช้ openclaw node pair แทน SSH tunnel — auto-reconnect, shared auth, task delegation built-in
Priority: MEDIUM
Smart Model Routing
First → Opus 4.6 (reasoning) · Coding → Codex on M4 · Routine → MiniMax M2.5 · Audit → Sonnet 4
Priority: LOW
Config as Code
Git repo สำหรับ config ทั้ง 2 เครื่อง — version control, diff-able, deploy script

🎯 Ideal Architecture (Next Iteration)

☁️ Cloudflare Edge 🖥️ iMac (PRIMARY) All Agents · All Channels · Auth Source · CF Tunnel Node Protocol 💻 M4 (WORKER NODE) Codex Workers · Docker · Heavy Compute · No own gateway

Key: M4 เป็น pure worker — auth ไหลจาก iMac, ไม่มี SSH tunnel, swap/replace ได้ง่าย

📋 Reproduction Manual (6 Steps)

1
Install OpenClaw on Both Machines
brew install openclaw-cli && openclaw init
2
Configure Primary (iMac) — Gateway + Auth + Channels
openclaw auth add anthropic --api-key "sk-..."
openclaw channels add whatsapp
3
Create Agent Team — SOUL.md + workspace per agent
openclaw agents add pae --model "minimax-portal/MiniMax-M2.5"
4
Set Up Secondary (M4) — Gateway + Auth sync
scp primary:~/.openclaw/.../auth-profiles.json ~/.openclaw/.../
5
Connect via Tailscale VPN
brew install tailscale && tailscale up
6
Set Up Cloudflare Tunnel (Primary only)
cloudflared tunnel create skillsauce && cloudflared tunnel run

📊 Quick Reference

ItemiMacM4
RoleCommand CenterCompute Worker
OSmacOS 12.7.6 (x64)macOS 26.3.1 (ARM64)
Tailscale100.73.43.19100.77.213.56
Gateway:18789 (loopback):18789 (lan)
Agents7 (First, Pae, Vault, Chief, CDO, Guard, Dev)0
Auth Keys9 providers1 provider
Docker❌ FORBIDDEN✅ via colima
CF TunnelOrigin (cloudflared)Via Tailscale