You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When main session + sub-agents both edit a shared task file, the edit
tool's exact-match requirement causes silent failures. Solution: split
into an immutable goals file (main session only) and an append-only
task log (sub-agents only append, never edit).
Also adds tip to keep AUTONOMOUS.md token-light by archiving completed
tasks to a separate file loaded only on-demand.
Verified in production over ~1 day of autonomous heartbeat workflows.
Copy file name to clipboardExpand all lines: usecases/overnight-mini-app-builder.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,40 @@ in real-time as you complete tasks.
81
81
- For overnight app building specifically: explicitly tell it to build MVPs and not to overcomplicate. You'll wake up every morning with a new surprise.
82
82
- This compounds over time — the agent learns what kinds of tasks are most helpful and adjusts.
When you run this workflow with sub-agents, both the main session and spawned sub-agents may try to update the same task file (e.g., your Kanban/AUTONOMOUS.md). This causes silent failures.
89
+
90
+
**Why it happens:** OpenClaw's `edit` tool requires an exact `oldText` match. If a sub-agent updates a line between the time your main session reads the file and tries to edit it, the text no longer matches — the edit silently fails.
91
+
92
+
**The fix: split your task file into two roles:**
93
+
94
+
1.**`AUTONOMOUS.md`** — stays small and clean. Contains only goals + open backlog. Only the main session touches this. Sub-agents never edit it.
95
+
96
+
2.**`memory/tasks-log.md`** — append-only log. Sub-agents only ever *add new lines at the bottom*. Never edit existing lines.
97
+
98
+
```markdown
99
+
# tasks-log.md — Completed Tasks (append-only)
100
+
# Sub-agents: always append to the END. Never edit existing lines.
101
+
102
+
### 2026-02-24
103
+
- ✅ TASK-001: Research competitors → research/competitors.md
104
+
- ✅ TASK-002: Draft blog post → drafts/post-1.md
105
+
```
106
+
107
+
This pattern is borrowed from Git's commit log: you never rewrite history, you only add new commits. It eliminates race conditions entirely and has a bonus: `AUTONOMOUS.md` stays small, so it costs fewer tokens every time it's loaded in a heartbeat.
108
+
109
+
**Rule to give your agent:** In sub-agent spawn instructions, always include:
110
+
> "When done, append a ✅ line to `memory/tasks-log.md`. Never edit `AUTONOMOUS.md` directly."
111
+
112
+
### 💡 Keep AUTONOMOUS.md Token-Light
113
+
114
+
The task tracking file gets loaded on every heartbeat poll. If it grows unbounded with completed tasks, you'll burn tokens unnecessarily.
115
+
116
+
Keep `AUTONOMOUS.md` under ~50 lines: goals (one-liners) + open backlog only. Archive everything completed to a separate file that is only read on-demand.
117
+
84
118
## Based On
85
119
86
120
Inspired by [Alex Finn](https://www.youtube.com/watch?v=UTCi_q6iuCM&t=414s) and his [video on life-changing OpenClaw use cases](https://www.youtube.com/watch?v=41_TNGDDnfQ).
0 commit comments