feat: update .gitignore to include flows directory and adjust clawteam templates exclusion; enhance LEARNINGS.md and RULES.md with critical spawn method guidelines; revise TOOLS.md to emphasize tmux usage; modify SKILL.md files to prohibit subprocess backend; increase memory limit in docker-compose.yml
This commit is contained in:
@@ -25,6 +25,8 @@
|
|||||||
!.openclaw/canvas/.gitkeep
|
!.openclaw/canvas/.gitkeep
|
||||||
.openclaw/update-check.json
|
.openclaw/update-check.json
|
||||||
|
|
||||||
|
.openclaw/flows/
|
||||||
|
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# 3. WORKSPACE ISOLATION (GIỮ KHUNG SƯỜN)
|
# 3. WORKSPACE ISOLATION (GIỮ KHUNG SƯỜN)
|
||||||
# ==========================================
|
# ==========================================
|
||||||
|
|||||||
@@ -294,3 +294,40 @@ User explicitly required: khi review code thì phải cực kỳ khắt khe, ph
|
|||||||
- First-Seen: 2026-04-06
|
- First-Seen: 2026-04-06
|
||||||
- Last-Seen: 2026-04-06
|
- Last-Seen: 2026-04-06
|
||||||
---
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [LRN-20260406-001] clawteam_spawn_method
|
||||||
|
|
||||||
|
**Logged**: 2026-04-06T10:10:00Z
|
||||||
|
**Priority**: critical
|
||||||
|
**Status**: resolved
|
||||||
|
**Area**: orchestration
|
||||||
|
|
||||||
|
### Summary
|
||||||
|
**Never use subprocess for spawning agents.** Always use `clawteam spawn tmux openclaw --team <team> --agent-name <name> --agent-type <type> --task "<task>"`.
|
||||||
|
|
||||||
|
### Details
|
||||||
|
When spawning ClawTeam agents, using `clawteam spawn subprocess openclaw` causes agents to die immediately after the subprocess shell exits. This resulted in:
|
||||||
|
- All 12 agents spawning but dying instantly
|
||||||
|
- 75 tasks all remaining `pending` with 0 `in_progress` because no one was alive to work
|
||||||
|
- Tasks falsely marked `completed` (only directory copying happened, not actual development)
|
||||||
|
- Zero dependency tracking (all tasks independent despite clear ordering requirements)
|
||||||
|
- Complete project management failure
|
||||||
|
|
||||||
|
### Suggested Action
|
||||||
|
- **ALWAYS** use `clawteam spawn tmux openclaw --team <team> --agent-name <name> ...` for persistent agent sessions
|
||||||
|
- **NEVER** use `clawteam spawn subprocess` — it exits immediately after the shell terminates
|
||||||
|
- Verify agents are alive: `tmux list-sessions | grep clawteam`
|
||||||
|
- Check task progress: `clawteam task list <team> --status in_progress`
|
||||||
|
- Set task dependencies with `clawteam task update <team> <id> --add-blocked-by <dep-id>`
|
||||||
|
- Monitor progress: `clawteam board attach <team>`
|
||||||
|
|
||||||
|
### Metadata
|
||||||
|
- Source: error
|
||||||
|
- Tags: clawteam, spawn, subprocess, orchestration, critical
|
||||||
|
- Pattern-Key: clawteam.spawn_method
|
||||||
|
- Recurrence-Count: 1
|
||||||
|
- First-Seen: 2026-04-06
|
||||||
|
- Last-Seen: 2026-04-06
|
||||||
|
|
||||||
|
|||||||
@@ -149,5 +149,20 @@ When PM receives escalated issue:
|
|||||||
4. If re-assigning: new worker gets full context (error logs, target files, what was tried)
|
4. If re-assigning: new worker gets full context (error logs, target files, what was tried)
|
||||||
5. Never add rework to existing blocked task — either unblock it or reassign entirely
|
5. Never add rework to existing blocked task — either unblock it or reassign entirely
|
||||||
|
|
||||||
### 6. Usage Pattern
|
### 6. Spawn Method (ABSOLUTE RULE — ZERO EXCEPTIONS)
|
||||||
|
**ALWAYS** use `clawteam spawn tmux openclaw --team <team> --agent-name <name> --agent-type <type> --task "<task>"`
|
||||||
|
**NEVER EVER** use `clawteam spawn subprocess` — subprocess agents die immediately after the shell exits, resulting in:
|
||||||
|
- All spawned agents dying instantly (0 workers alive)
|
||||||
|
- Task counts stuck at 0 in_progress, 75+ tasks never started
|
||||||
|
- False "completed" statuses (files created by manual copy, not by agents)
|
||||||
|
- Zero dependency tracking despite clear ordering requirements
|
||||||
|
- Complete project management failure
|
||||||
|
|
||||||
|
**Verification after spawning:**
|
||||||
|
- `tmux list-sessions | grep clawteam` — expect 1 session per agent
|
||||||
|
- `clawteam task list <team> --status in_progress` — expect tasks actively working
|
||||||
|
- `clawteam board attach <team>` — monitor progress in real-time
|
||||||
|
- `clawteam task list <team> --status blocked` — check for blocked tasks and resolve
|
||||||
|
|
||||||
|
### 7. Usage Pattern
|
||||||
When the user requests to use ClawTeam, do NOT use `sessions_spawn` with `runtime="acp"`. Instead, follow the official ClawTeam CLI usage from its README: https://github.com/HKUDS/ClawTeam. Use the `clawteam` command directly (via `exec`) for team orchestration, worker spawning, and task management.
|
When the user requests to use ClawTeam, do NOT use `sessions_spawn` with `runtime="acp"`. Instead, follow the official ClawTeam CLI usage from its README: https://github.com/HKUDS/ClawTeam. Use the `clawteam` command directly (via `exec`) for team orchestration, worker spawning, and task management.
|
||||||
|
|||||||
@@ -58,12 +58,16 @@ clawteam team spawn-team <team-name> -d "<description>" -n leader
|
|||||||
# Then create tasks matching template.tasks
|
# Then create tasks matching template.tasks
|
||||||
clawteam task create <team> "<task>" -o <owner>
|
clawteam task create <team> "<task>" -o <owner>
|
||||||
# Spawn workers matching template.agents
|
# Spawn workers matching template.agents
|
||||||
clawteam spawn subprocess openclaw --team <team> --agent-name <name> --task "..."
|
# ❌ WRONG: NEVER use subprocess — agents die immediately after shell exits
|
||||||
|
# clawteam spawn subprocess openclaw --team <team> --agent-name <name> --task "..."
|
||||||
|
|
||||||
|
# ✅ CORRECT: always use tmux openclaw for persistent agent sessions
|
||||||
|
clawteam spawn tmux openclaw --team <team> --agent-name <name> --task "..."
|
||||||
```
|
```
|
||||||
|
|
||||||
## ClawTeam Multi-Agent Orchestration
|
## ClawTeam Multi-Agent Orchestration
|
||||||
|
|
||||||
> **Important:** ClawTeam CLI command is `clawteam`. ALWAYS specify `tmux openclaw` or `subprocess openclaw` as backend+agent — default `claude` is not available.
|
> **Important:** ClawTeam CLI command is `clawteam`. **ALWAYS** specify `tmux openclaw` as the backend — **NEVER** use `subprocess`. Default `claude` is not available.
|
||||||
> Official repo: https://github.com/HKUDS/ClawTeam
|
> Official repo: https://github.com/HKUDS/ClawTeam
|
||||||
|
|
||||||
### ⚠️ CRITICAL: Spawn Syntax
|
### ⚠️ CRITICAL: Spawn Syntax
|
||||||
@@ -246,8 +250,11 @@ clawteam task create <team> "<task>" -o <owner>
|
|||||||
clawteam spawn tmux openclaw --team <team> --agent-name <name> --agent-type coder \
|
clawteam spawn tmux openclaw --team <team> --agent-name <name> --agent-type coder \
|
||||||
--task "Do X. After done: clawteam task update <team> <TASK_ID> --status completed"
|
--task "Do X. After done: clawteam task update <team> <TASK_ID> --status completed"
|
||||||
|
|
||||||
# Or with subprocess (faster, no tmux monitor)
|
# ❌ WRONG — subprocess agents die immediately; never use this
|
||||||
clawteam spawn subprocess openclaw --team <team> --agent-name <name> --task "..."
|
# clawteam spawn subprocess openclaw --team <team> --agent-name <name> --task "..."
|
||||||
|
|
||||||
|
# ✅ ALWAYS use tmux (persistent, monitorable, survives network blips)
|
||||||
|
# clawteam spawn tmux openclaw --team <team> --agent-name <name> --task "..."
|
||||||
|
|
||||||
# View board
|
# View board
|
||||||
clawteam board show <team>
|
clawteam board show <team>
|
||||||
@@ -259,3 +266,11 @@ clawteam task update <team> <task-id> --status completed
|
|||||||
- `--model` (model is set by OpenClaw config, not clawteam)
|
- `--model` (model is set by OpenClaw config, not clawteam)
|
||||||
- `--timeout` (no timeout flag on spawn)
|
- `--timeout` (no timeout flag on spawn)
|
||||||
- `-m` (conflicts with clawteam's own options)
|
- `-m` (conflicts with clawteam's own options)
|
||||||
|
|
||||||
|
### 📌 Critical Reminders
|
||||||
|
- **ALWAYS use `tmux openclaw`** — `subprocess` agents die immediately
|
||||||
|
- **Set task dependencies**: `clawteam task update <team> <id> --add-blocked-by <dep-id>`
|
||||||
|
- **Verify agents alive**: `tmux list-sessions | grep clawteam`
|
||||||
|
- **Monitor progress**: `clawteam board attach <team>`
|
||||||
|
- **Check in-progress tasks**: `clawteam task list <team> --status in_progress`
|
||||||
|
- **Unblock stuck tasks**: use `clawteam task update <team> <id> --status pending` after resolving blocker
|
||||||
|
|||||||
@@ -214,9 +214,9 @@ ls ~/.clawteam/workspaces/ 2>&1 | grep -q "No such file" && echo "OK: no workspa
|
|||||||
|
|
||||||
Add `--transport p2p` and `export CLAWTEAM_TRANSPORT=p2p` before Step 3 to test ZeroMQ direct messaging with file fallback. The rest of the steps remain the same.
|
Add `--transport p2p` and `export CLAWTEAM_TRANSPORT=p2p` before Step 3 to test ZeroMQ direct messaging with file fallback. The rest of the steps remain the same.
|
||||||
|
|
||||||
### With subprocess Backend
|
### ⚠️ Do NOT use subprocess backend
|
||||||
|
|
||||||
Replace `clawteam spawn` with `clawteam spawn subprocess claude` to test the subprocess backend instead of tmux. Note: `board attach` and tmux verification steps won't apply.
|
The `subprocess` backend causes agents to die immediately after the shell exits. **Always use the tmux backend** for persistent agent sessions.
|
||||||
|
|
||||||
## What This Test Validates
|
## What This Test Validates
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ Replace `clawteam spawn` with `clawteam spawn subprocess claude` to test the sub
|
|||||||
|-----------|-----------|
|
|-----------|-----------|
|
||||||
| `team spawn-team` | Team creation with leader |
|
| `team spawn-team` | Team creation with leader |
|
||||||
| `task create --blocked-by` | Task dependency chains |
|
| `task create --blocked-by` | Task dependency chains |
|
||||||
| `spawn` (tmux backend) | Agent process launch with worktree isolation |
|
| `spawn` (tmux backend only) | Agent process launch with worktree isolation |
|
||||||
| Identity propagation | Env vars passed to sub-agents |
|
| Identity propagation | Env vars passed to sub-agents |
|
||||||
| Agent coordination | Workers update task status and send messages to leader |
|
| Agent coordination | Workers update task status and send messages to leader |
|
||||||
| Auto-unblock | Blocked task unblocked when dependencies complete |
|
| Auto-unblock | Blocked task unblocked when dependencies complete |
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ clawteam board live my-team --interval 3
|
|||||||
|
|
||||||
| Setting | Default | Override |
|
| Setting | Default | Override |
|
||||||
|---------|---------|----------|
|
|---------|---------|----------|
|
||||||
| Backend | `tmux` | `clawteam spawn subprocess ...` |
|
| Backend | `tmux` only | Use `clawteam spawn tmux openclaw` — subprocess NOT allowed |
|
||||||
| Command | `claude` (default) / `openclaw` (ours) | `clawteam spawn tmux openclaw` for our setup |
|
| Command | `claude` (default) / `openclaw` (ours) | `clawteam spawn tmux openclaw` for our setup |
|
||||||
| Workspace | `auto` (git worktree) | `--no-workspace` or config `workspace=never` |
|
| Workspace | `auto` (git worktree) | `--no-workspace` or config `workspace=never` |
|
||||||
| Permissions | skip | `--no-skip-permissions` or config `skip_permissions=false` |
|
| Permissions | skip | `--no-skip-permissions` or config `skip_permissions=false` |
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ services:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: '4'
|
cpus: '4'
|
||||||
memory: 8G
|
memory: 10G
|
||||||
reservations:
|
reservations:
|
||||||
memory: 2G
|
memory: 2G
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user