openclaw - 💡(How to fix) Fix [Proposal] Skill-based task routing for multi-agent setups [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#50073Fetched 2026-04-08 00:59:27
View on GitHub
Comments
2
Participants
2
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×2

Code Example

User: "Deploy my site to GitHub Pages"
Coordinator → sends to Agent B (design agent — wrong)
Agent B: "Not my job" → forwards to Agent A (dev agent)
Agent A: [actually does the work]

---

Available agents and capabilities:
- agent-dev: github, docker, openclaw-debug (tools: exec, browser)
- agent-design: nano-banana-pro, video-frames (tools: image, tts)
- agent-ops: notion, calendar (tools: web_search)
RAW_BUFFERClick to expand / collapse

Problem

In multi-agent setups, the coordinator agent decides which agent handles each task based on its own memory of each agent's role. This causes:

  • Misrouting — coordinator sometimes sends to the wrong agent
  • Extra hops — wrong agent receives, realizes it's not their job, forwards to the right one (2 hops = 2x token cost)
  • No capability awareness — coordinator doesn't know what tools/skills each agent actually has loaded
  • Scaling problem — adding a new agent requires manually updating the coordinator's prompt

Example

User: "Deploy my site to GitHub Pages"
Coordinator → sends to Agent B (design agent — wrong)
Agent B: "Not my job" → forwards to Agent A (dev agent)
Agent A: [actually does the work]

Two hops, double the tokens. The correct routing was obvious: only Agent A has the github skill loaded.

Proposal

Phase 1: Capability index (low effort)

Build a runtime index from existing data — each agent's loaded skills, available tools, and SOUL.md description. Inject a routing hint into the coordinator's system prompt:

Available agents and capabilities:
- agent-dev: github, docker, openclaw-debug (tools: exec, browser)
- agent-design: nano-banana-pro, video-frames (tools: image, tts)
- agent-ops: notion, calendar (tools: web_search)

The coordinator still decides, but with perfect information instead of guessing from memory.

Phase 2: Auto-routing (optional, default off)

For messages matching a clear skill pattern (e.g., "deploy to GitHub" → only one agent has github skill), bypass the coordinator and route directly. Ambiguous tasks still go through the coordinator.

Benefits

BeforeAfter
Coordinator guesses from memoryCoordinator sees real-time capability list
Misrouted tasks bounce between agentsDirect routing, fewer hops
Adding agent = update coordinator promptAdding agent = auto-discovered

Relation to existing work

  • PR #50066's bus.jsonl provides communication history — routing could factor in past success rates
  • Could integrate with Agent Cards for standardized capability declaration
  • Phase 1 is ~200 lines, Phase 2 ~350 lines. Both default disabled, 0 breaking changes.

Open question

Should the capability index be injected automatically into every coordinator prompt, or gated behind a config flag? Automatic is simpler but adds prompt length; opt-in requires user awareness.

extent analysis

Fix Plan

To address the misrouting and extra hops issues, we will implement a capability index and auto-routing system. Here are the steps:

  • Phase 1: Capability Index
    • Create a runtime index of each agent's loaded skills, available tools, and SOUL.md description.
    • Inject a routing hint into the coordinator's system prompt with the available agents and capabilities.
    • Example code snippet:
# Get agent capabilities
agent_capabilities = {
    'agent-dev': ['github', 'docker', 'openclaw-debug'],
    'agent-design': ['nano-banana-pro', 'video-frames'],
    'agent-ops': ['notion', 'calendar']
}

# Create routing hint
routing_hint = "Available agents and capabilities:\n"
for agent, capabilities in agent_capabilities.items():
    routing_hint += f"- {agent}: {', '.join(capabilities)}\n"

# Inject routing hint into coordinator's system prompt
coordinator_prompt = f"{routing_hint} {coordinator_prompt}"
  • Phase 2: Auto-routing (optional)
    • Implement a system to bypass the coordinator and route directly for messages matching a clear skill pattern.
    • Example code snippet:
# Define skill patterns
skill_patterns = {
    'github': ['deploy to github'],
    'docker': ['run docker container']
}

# Check if message matches a skill pattern
def match_skill_pattern(message):
    for skill, patterns in skill_patterns.items():
        for pattern in patterns:
            if pattern in message:
                return skill
    return None

# Route message directly if skill pattern matches
def route_message(message):
    skill = match_skill_pattern(message)
    if skill:
        # Get agent with matching skill
        agent = next((agent for agent, capabilities in agent_capabilities.items() if skill in capabilities), None)
        if agent:
            # Route message directly to agent
            return agent
    # Default to coordinator routing
    return None

Verification

To verify the fix, test the following scenarios:

  • Misrouting: Send a message that requires a specific skill (e.g., "deploy to GitHub") and verify that it is routed directly to the correct agent.
  • Extra hops: Send a message that requires a specific skill and verify that it is not forwarded to multiple agents.
  • Capability awareness: Verify that the coordinator's system prompt includes the available agents and capabilities.
  • Scaling: Add a new agent and verify that it is automatically discovered and included in the capability index.

Extra Tips

  • Consider integrating the capability index with Agent Cards for standardized capability declaration.
  • Use the bus.jsonl file to factor in past success rates when routing messages.
  • Default the auto-routing feature to off and require users to opt-in to avoid adding prompt length.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Proposal] Skill-based task routing for multi-agent setups [2 comments, 2 participants]