diff --git a/.claude/commands/fleet-announce.md b/.claude/commands/fleet-announce.md index ac6f855..fc13812 100644 --- a/.claude/commands/fleet-announce.md +++ b/.claude/commands/fleet-announce.md @@ -89,12 +89,22 @@ Send all? Or edit? Look up the notification channel and recipient ID from each person's fleet file, then send via SSH: -```bash -ssh "openclaw message send --channel -t -m ''" +```python +import subprocess, shlex + +msg = "" # the crafted message +cmd = ( + f"openclaw message send" + f" --channel " + f" --target " + f" --message {shlex.quote(msg)}" +) +subprocess.run(["ssh", "", cmd]) ``` -**Important:** Single quotes in the message must be escaped. Messages come FROM their -bot, not from the fleet owner. +**Why Python:** Shell quoting is unreliable for natural-language messages that contain +contractions (`don't`), dollar signs, or backticks. `shlex.quote()` handles all of these +correctly. Messages come FROM their bot, not from the fleet owner. ## 5. Confirm diff --git a/templates/BOOT.md b/templates/BOOT.md index 5f0f706..468161d 100644 --- a/templates/BOOT.md +++ b/templates/BOOT.md @@ -4,14 +4,10 @@ When the gateway starts (or restarts), run through this checklist before doing a else. This is your "waking up" moment — orient yourself, check what happened while you were offline, and get ready. -## 1. Orient +## 1. Conversation Recovery (Was I Mid-Conversation?) -- Read `SOUL.md` — remember who you are -- Read `USER.md` — remember who you're helping -- Read `memory/YYYY-MM-DD.md` (today) — what happened so far today? -- If today's file doesn't exist, read yesterday's — pick up where you left off - -## 2. Conversation Recovery (Was I Mid-Conversation?) +**Do this first — time-sensitive.** The 1-minute window starts from the restart, not +from when you finish orienting. Check the session store before reading any other files. Check if a restart interrupted an active conversation. @@ -28,20 +24,28 @@ Check if a restart interrupted an active conversation. **If interrupted (< 1 min ago):** -1. Read the last 20 lines of that session's JSONL transcript -2. Extract the last few user messages and your last response -3. Write a short summary of the interrupted conversation to a temp note: what was being +1. Run Orient (Step 2) — load your identity and context before reaching out +2. Read the last 20 lines of that session's JSONL transcript +3. Extract the last few user messages and your last response +4. Write a short summary of the interrupted conversation to a temp note: what was being discussed, what the user last asked, what you were working on -4. Send the user a message via the `message` tool on the channel where the conversation +5. Send the user a message via the `message` tool on the channel where the conversation was happening: - Keep it brief: "Just restarted. We were working on [X]. Want to pick up where we left off?" - Include enough context that they can say "yes, continue" without re-explaining -5. Reply with NO_REPLY after sending the message +6. Reply with NO_REPLY after sending the message **If NOT interrupted (> 1 min ago or no recent direct conversation):** -- Skip to step 3 (check for unfinished work) +- Continue to step 2 (Orient) + +## 2. Orient + +- Read `SOUL.md` — remember who you are +- Read `USER.md` — remember who you're helping +- Read `memory/YYYY-MM-DD.md` (today) — what happened so far today? +- If today's file doesn't exist, read yesterday's — pick up where you left off ## 3. Check for Unfinished Work @@ -53,7 +57,7 @@ Check if a restart interrupted an active conversation. Don't message your human on routine restarts. Only reach out if: -- Step 2 detected an interrupted conversation (already handled above) +- Step 1 detected an interrupted conversation (already handled above) - You found unfinished urgent work that needs their attention - Something is broken that was working before - It's been >24h since any interaction (check-in is appropriate)