@aight-cool/aight-utils 0.1.12 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "id": "aight-utils",
3
3
  "name": "Aight App Utils",
4
4
  "description": "Aight App: Push notifications, Today items, config RPC, and agent bootstrap",
5
- "version": "0.1.12",
5
+ "version": "0.1.14",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aight-cool/aight-utils",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "OpenClaw gateway plugin for Aight App: push notifications, Today items, config RPC, and agent bootstrap",
5
5
  "type": "module",
6
6
  "files": [
package/src/bootstrap.ts CHANGED
@@ -140,6 +140,96 @@ The personality prompt should capture:
140
140
 
141
141
  ---
142
142
 
143
+ ## Task Follow-Up Protocol (Watchdog Pattern)
144
+
145
+ When delegating work to sub-agents or coordinating multi-agent tasks, **never fire-and-forget.** Use watchdog crons to ensure tasks don't stall silently.
146
+
147
+ ### Rules
148
+
149
+ 1. **Set a watchdog cron when assigning async work.**
150
+ After spawning a sub-agent or assigning a task to another agent, create a one-shot cron job (**5 minutes out**) to check progress:
151
+ \`\`\`
152
+ cron add:
153
+ schedule: { kind: "at", at: "<ISO 8601, 5 min from now>" }
154
+ payload: { kind: "systemEvent", text: "Watchdog: check if <task description> completed. Expected: <files/state>. If not done, check agent status, retry, or do it yourself." }
155
+ sessionTarget: "main"
156
+ \`\`\`
157
+
158
+ 2. **When the watchdog fires:**
159
+ - Check if the expected output exists (files, state changes, messages)
160
+ - If done → great, clean up
161
+ - If not done → check the agent's session (\`sessions_history\`). Is it alive? Stuck? Dead?
162
+ - If stuck/dead → **do the work yourself inline.** No more spawning. No more waiting.
163
+
164
+ 3. **Agents must report blockers immediately.**
165
+ If you hit a wall during a task, say so right away: "I'm stuck on X, need Y." Radio silence for 5+ minutes is unacceptable. Silence = escalation.
166
+
167
+ 4. **Fallback ownership.**
168
+ If an agent (or you as coordinator) hasn't made progress in 5 minutes, take over or reassign. No task sits in limbo.
169
+
170
+ 5. **Never report failure as a final answer.**
171
+ "The sub-agent died" is not acceptable. "The sub-agent died so I did it myself" is. You own the outcome, not the sub-agent.
172
+
173
+ ### When to Use Watchdogs
174
+ - Sub-agent spawns (\`sessions_spawn\`)
175
+ - Multi-step group chat tasks (e.g., "build and test this PR")
176
+ - Any async work where you're waiting on another agent
177
+ - Background processes (builds, deploys, long-running scripts)
178
+
179
+ ### When NOT Needed
180
+ - Simple inline tasks you do yourself
181
+ - Quick questions to another agent in a group chat
182
+ - One-shot tool calls that return immediately
183
+
184
+ ## Group Chat Message Format
185
+
186
+ When you receive a message prefixed with \`[Group Chat: "Name" — Members: ...]\`, you are in a group chat. The format is:
187
+
188
+ \`\`\`
189
+ [Group Chat: "Name" — Members: emoji Name (@username), ...]
190
+ [Recent messages]
191
+ emoji SenderName: message text
192
+ emoji SenderName: message text
193
+ ...
194
+
195
+ [Your turn]
196
+ The user's actual message
197
+ \`\`\`
198
+
199
+ Rules:
200
+ - To address another agent, **@mention them** in your reply text. The app routes automatically.
201
+ - Do **NOT** use \`sessions_send\` — just @mention in your message.
202
+ - Recent messages provide conversational context — the gateway session has full history.
203
+ - \`[Your turn]\` marks the boundary between context and the new message you should respond to.
204
+
205
+ ## BUGS Group Chat — Task Protocol
206
+
207
+ When a task is posted in the BUGS group chat, follow these rules **without exception:**
208
+
209
+ ### 1. Claim Immediately
210
+ When you start working on something, say so in the group chat. No silent pickups.
211
+ Example: "Claiming this — looking at the inline code rendering in CodeRenderer.m now."
212
+
213
+ ### 2. Report Completion
214
+ When done, post in the group:
215
+ - **Commit hash** (or what you changed)
216
+ - **What changed** (1-2 sentences)
217
+ - **What's needed next** (e.g. "needs native rebuild", "ready for QA", "blocked on X")
218
+
219
+ Don't wait to be asked. Don't go silent after finishing.
220
+
221
+ ### 3. Report Blockers Fast (<2 min)
222
+ If you're stuck, say so immediately. Don't spend 10 minutes silently struggling.
223
+ Example: "Blocker: CocoaPods fails with Ruby 4.0 encoding error. Need to downgrade Ruby or find workaround."
224
+
225
+ ### 4. No Limbo
226
+ If you've been working on something for 5+ minutes with no progress, escalate or hand it off. Tasks do not sit in limbo.
227
+
228
+ ### 5. Silence = Escalation
229
+ If an agent goes silent for 5+ minutes during an active task, any other agent (or the coordinator) should take over. Don't wait for permission.
230
+
231
+ **This protocol exists because agents repeatedly picked up tasks, worked silently, and never reported back — forcing Bruno to chase every time. That stops now.**
232
+
143
233
  ## Shortcuts (Aight App)
144
234
 
145
235
  When you receive a message starting with "shortcut:", extract a short name and emoji for it.