← 返回
未分类 中文

Subagent Orchestration

Orchestrate OpenClaw subagents effectively. Covers all three agent types (Worker, Researcher, Council) with correct spawning patterns, sandbox constraints, t...
有效编排 OpenClaw 子代理,覆盖全部三种代理类型(Worker、Researcher、Council),包括正确的生成模式和沙箱约束等。
wahajahmed010
未分类 clawhub v1.3.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 430
下载
💾 1
安装
1
版本
#latest

概述

Subagent Orchestration

Agent Types

TypeToolsUse For
----------------------
WorkerDefault (no web)File ops, script execution, git, code changes
Researcherollama_web_search, ollama_web_fetchWeb research, API lookups, live data
CouncilDefault (no web)Analysis, review, decision-making with passed context

Sandbox Constraints

Default subagents (Worker/Council) cannot:

  • Use ollama_web_fetch or ollama_web_search
  • Run python3 -c "..." inline commands
  • Access the main session's conversation history

They can:

  • Read/write files
  • Run scripts from .py files (python3 /path/to/script.py)
  • Execute simple shell commands
  • Use exec, read, write, edit tools

Spawning Patterns

Researcher (Web-Enabled)

sessions_spawn(
  toolsAllow: ["ollama_web_fetch", "ollama_web_search"],
  runtime: "subagent",
  mode: "run",
  lightContext: true,
  runTimeoutSeconds: 600,
  task: "Research X. Return: findings, sources, key metrics."
)

Worker (File/Code Ops)

sessions_spawn(
  runtime: "subagent",
  mode: "run",
  lightContext: true,
  runTimeoutSeconds: 300,
  task: "Run python3 /path/to/script.py. Report output."
)

Council (Multi-Model Deliberation)

# Spawn 3 parallel subagents with different models and perspectives
# See skills/council-of-llms/SKILL.md for full details
sessions_spawn(model: "ollama/kimi-k2.6:cloud", label: "Council-Strategos", ...)
sessions_spawn(model: "ollama/deepseek-v4-pro:cloud", label: "Council-Analyticos", ...)
sessions_spawn(model: "ollama/gemma4:31b-cloud", label: "Council-Creativos", ...)
# Then synthesize all 3 outputs into a unified verdict

Single-Model Council (Legacy — Avoid)

# WARNING: Single-model councils cause context overflow and produce shallow analysis
# Use multi-model pattern above instead
sessions_spawn(
  runtime: "subagent",
  mode: "run",
  lightContext: true,
  runTimeoutSeconds: 900,
  task: "Review this data and decide: [data pasted inline]. Return: verdict, conditions, risks."
)

Timeout Strategy

Task TypeMin TimeoutRecommended
------------------------------------
Simple file ops120s180s
Research (web)300s600s
Council/review300s600s
Complex multi-step600s900s

Never rush agents. Quality > speed. If an agent takes >60s, give the user a brief status update.

Delegation Rules

  1. Never run long scripts yourself. Write the script, hand the file path to a subagent.
  2. Pre-fetch web content yourself for Worker/Council agents — they can't browse.
  3. Use Researcher agents when you need web data that subagents can't access.
  4. Write .py files first — don't pass inline Python to subagents.
  5. Paste context inline — Council agents don't have your conversation history.

Common Failure Modes

SymptomCauseFix
---------------------
Agent times outCan't access web toolsUse toolsAllow or pre-fetch content
Agent times outCan't run inline PythonWrite .py file, pass path
Agent times outrunTimeoutSeconds too lowSet runTimeoutSeconds: 900 in spawn call
Agent times outGateway under load (10s spawn timeout)Kill zombie subagents, wait, retry
Agent returns nothingMissing contextPaste data in task parameter
Agent stuck in loopVague taskAdd explicit "return X" instruction
Gateway crashesContext overflow on spawnUse lightContext: true
Spawn fails (10s gateway timeout)Gateway CPU overloadKill stale subagents first, then retry

Anti-Patterns

  • ❌ Doing research yourself when a Researcher agent could handle it
  • ❌ Running python3 -c inline in task descriptions
  • ❌ Setting 120s timeouts on research tasks
  • ❌ Re-spawning an agent that's still running (>60s = be patient)
  • ❌ Not passing context because "the agent should know"

Config (openclaw.json)

Set subagent defaults in ~/.openclaw/openclaw.json:

{
  "agents": {
    "defaults": {
      "subagents": {
        "runTimeoutSeconds": 900,
        "maxConcurrent": 5
      }
    }
  }
}

Also set in ~/.openclaw/council-config.json:

{
  "default_timeout": 900,
  "max_tokens": 8192
}

版本历史

共 1 个版本

  • v1.3.0 当前
    2026-05-03 10:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Open Source Contributor

wahajahmed010
使用建筑师‑建造者模式的自主 GitHub 贡献代理。Buck(主代理)负责所有 git/网络 I/O;子代理负责专注的认知任务。
★ 0 📥 530

Overleaf LaTeX

wahajahmed010
通过 Git 集成或原生代理工具管理 OverleafLaTeX 项目。安装 @wahajahmed010/openclaw-overleaf 插件可获得 6 个原生工具(克隆、分支...)
★ 0 📥 495

Council Of Llms

wahajahmed010
真实的OpenClaw子代理多模型委员会审议:生成3个并行子代理,各自使用不同的大语言模型并拥有独特的分析视角(策略、…)
★ 1 📥 687