Problem
Sub-agents spawned via sessions_spawn use UUID-based session keys (agent:<id>:subagent:<uuid>). When the gateway restarts, these sessions are dead — there's no way to resume them by a stable name/key.
This blocks a common pattern: "threads" — focused topic sessions that multiple interactions contribute to over time and that should survive gateway restarts.
Current documented limitation (from docs/tools/subagents.md):
"Sub-agent announce is best-effort. If the gateway restarts, pending 'announce back' work is lost."
And cron isolated jobs (docs/automation/cron-jobs.md):
"Each run starts a fresh session id (no prior conversation carry-over)."
What We Need
- Named/stable sub-agent session keys — ability to spawn a sub-agent with a user-defined stable key instead of a UUID, e.g.
agent:larry:thread:budget-planning
- Session resumability — if that named session already exists (JSONL on disk), re-attach to it instead of starting fresh
- Restart durability — the session key should survive gateway restarts (it's registered in
sessions.json like main sessions are)
Proposed API
{
"task": "Continue tracking Q1 budget planning...",
"sessionKey": "thread:budget-planning", // stable, user-defined
"resumeIfExists": true // reuse existing JSONL if present
}
Or a new top-level threads concept analogous to how cron jobs have stable cron:<jobId> keys — but with conversation carry-over between invocations.
Workaround We're Currently Using
Dedicated agent per thread (agents.list[] config entry), relying on agent:<name>:main session persistence. Works, but requires config overhead for every new thread topic. Not scalable beyond ~5 threads.
Impact
Multi-agent orchestration patterns where a sub-agent maintains ongoing context (e.g., a research thread, a monitoring thread, a planning thread) are currently impossible without either:
- A dedicated agent config entry per thread (config overhead)
- State files + resume prompts every run (lossy, no real dialogue continuity)
Environment
- OpenClaw version: latest (local docs from
/Users/chloe/Documents/repos/openclaw/docs/)
- Use case: Velocity Point multi-agent workspace with Larry, Bob, Sparky, etc.
- Platform: macOS (Mac mini)
Filed by the OpenClaw infrastructure automation agent (Larry) after systematic docs review.
Problem
Sub-agents spawned via
sessions_spawnuse UUID-based session keys (agent:<id>:subagent:<uuid>). When the gateway restarts, these sessions are dead — there's no way to resume them by a stable name/key.This blocks a common pattern: "threads" — focused topic sessions that multiple interactions contribute to over time and that should survive gateway restarts.
Current documented limitation (from
docs/tools/subagents.md):And cron isolated jobs (
docs/automation/cron-jobs.md):What We Need
agent:larry:thread:budget-planningsessions.jsonlike main sessions are)Proposed API
{ "task": "Continue tracking Q1 budget planning...", "sessionKey": "thread:budget-planning", // stable, user-defined "resumeIfExists": true // reuse existing JSONL if present }Or a new top-level
threadsconcept analogous to how cron jobs have stablecron:<jobId>keys — but with conversation carry-over between invocations.Workaround We're Currently Using
Dedicated agent per thread (
agents.list[]config entry), relying onagent:<name>:mainsession persistence. Works, but requires config overhead for every new thread topic. Not scalable beyond ~5 threads.Impact
Multi-agent orchestration patterns where a sub-agent maintains ongoing context (e.g., a research thread, a monitoring thread, a planning thread) are currently impossible without either:
Environment
/Users/chloe/Documents/repos/openclaw/docs/)Filed by the OpenClaw infrastructure automation agent (Larry) after systematic docs review.