diff --git a/src/servers/api/bots/brief.ts b/src/servers/api/bots/brief.ts index a11b2873..e5cb7f6b 100644 --- a/src/servers/api/bots/brief.ts +++ b/src/servers/api/bots/brief.ts @@ -111,14 +111,39 @@ Write the new value to \`$STATE\` **before** exiting, or the next arming fires o \`\`\` **Rewrite it every time you arm**, with the new pid. \`pids\` is an array because a re-arm can briefly - overlap; list every process you started that is still meant to be running. Your session id is the file - name you were told to use — if you do not know it, look at which transcript you are in. + overlap; list every process you started that is still meant to be running. -5. **When you are handed back**, do what the owner asked, then **re-arm the same script the same way, + **To find your own session id**, list the bots and match on the title: + +\`\`\`bash +curl -s -H "Authorization: Bearer $OFFICER_AGENT_KEY" -H "Host: $OFFICER_API_HOST" \\ + "$OFFICER_API_URL/api/chat/sessions?context=bots" +\`\`\` + + Claude titles a session from its first message, so on the turn that arms you the entry titled with the + owner's own opening sentence is you. That is only reliable BEFORE you rename yourself — which is the + next step, so do them in this order: find your id, write the record, then rename. + +5. **Give yourself a real name.** The automatic title is the owner's first sentence, truncated — + \`"can you notifiy me when https://newweb.fofos…"\`, typos and all. It is a prompt, not a name, and it is + what they will scan a list of bots for later. + +\`\`\`bash +curl -s -X PATCH -H "Authorization: Bearer $OFFICER_AGENT_KEY" -H "Host: $OFFICER_API_HOST" \\ + -H 'content-type: application/json' -d '{"title":"newweb uptime"}' \\ + "$OFFICER_API_URL/api/chat/sessions//title" +\`\`\` + + Two to four words, the SUBJECT and what is watched about it: \`newweb uptime\`, \`NYT front page\`, + \`gitea disk space\`. Not "Website Monitor Bot" — every bot is a monitor and the word earns nothing in a + list of them. Lower case unless the subject is a proper noun. Rename again if the owner widens what you + watch and the old name stops being true. + +6. **When you are handed back**, do what the owner asked, then **re-arm the same script the same way, before you end the turn**, and rewrite the record. Act, re-arm, record — in the one turn. Never build a second loop on top of this. -6. **If you are woken and told your watch is gone**, read your own \`.bot.json\`, arm the script it names +7. **If you are woken and told your watch is gone**, read your own \`.bot.json\`, arm the script it names again, and rewrite it. That file is what survives a reboot; the conversation may be days behind. Do not go hunting for how any of this works — it is above, and looking costs the owner a minute of tool