openclaw - 💡(How to fix) Fix Feature request: unified execution planner for task routing [1 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#55492Fetched 2026-04-08 01:38:54
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

OpenClaw is powerful, but task routing is still too implicit.

For many requests, the agent has to infer too much before starting work:

  • should this run in the main session?
  • should this be delegated to a sub-agent?
  • should this go through ACP?
  • does this require a skill load first?
  • does this require explicit confirmation?
  • is this a channel-sensitive action with special reply rules?

All of this logic exists today, but it is distributed across prompts, skills, conventions, and operator experience.

That makes execution feel less consistent than it could be.


Root Cause

This would make OpenClaw feel much more coherent by turning implicit routing knowledge into explicit product behavior.

It would improve:

  • consistency
  • safety
  • explainability
  • responsiveness
  • operator ergonomics

Code Example

{
  "mode": "direct",
  "reason": "simple local lookup",
  "risk": "low",
  "recommended_tools": ["read", "exec"],
  "skill_to_load": null,
  "requires_confirmation": false,
  "channel_policy": "reply_in_current_chat"
}

---

{
  "mode": "subagent",
  "reason": "multi-file coding task",
  "recommended_tools": ["sessions_spawn"],
  "skill_to_load": "coding-agent",
  "requires_confirmation": false
}
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw is powerful, but task routing is still too implicit.

For many requests, the agent has to infer too much before starting work:

  • should this run in the main session?
  • should this be delegated to a sub-agent?
  • should this go through ACP?
  • does this require a skill load first?
  • does this require explicit confirmation?
  • is this a channel-sensitive action with special reply rules?

All of this logic exists today, but it is distributed across prompts, skills, conventions, and operator experience.

That makes execution feel less consistent than it could be.


Why this is a problem

This creates friction for both users and agents:

  • more hesitation before execution
  • more hidden policy complexity
  • inconsistent tool/runtime selection
  • more room for mistakes in sensitive operations
  • higher mental overhead in multi-capability environments

In short, OpenClaw can do the right thing, but deciding how to start is often too implicit.


Proposed direction: unified execution planner

Introduce a lightweight planning/routing layer that classifies the task before execution.

Example shape:

{
  "mode": "direct",
  "reason": "simple local lookup",
  "risk": "low",
  "recommended_tools": ["read", "exec"],
  "skill_to_load": null,
  "requires_confirmation": false,
  "channel_policy": "reply_in_current_chat"
}

Useful dimensions:

  • task kind: question / search / local edit / external write / long-running
  • risk level: low / medium / high
  • expected duration: seconds / minutes / background
  • execution target: main / subagent / acp / confirm-first

Expected behavior

The planner should ideally:

  1. run automatically before execution
  2. stay invisible for obvious cases
  3. become visible when the route is ambiguous or high-risk
  4. support user override
  5. support agent reroute when task scope expands

Examples:

  • simple local lookup → direct
  • multi-file code task → subagent
  • explicit “use codex / claude code / gemini” → acp
  • external write action → confirm-first

UX possibilities

Possible surfaces:

  • internal planning API
  • CLI like openclaw route "..."
  • debug/explain mode
  • lightweight UI hint/card when needed

Example:

{
  "mode": "subagent",
  "reason": "multi-file coding task",
  "recommended_tools": ["sessions_spawn"],
  "skill_to_load": "coding-agent",
  "requires_confirmation": false
}

Why this matters

This would make OpenClaw feel much more coherent by turning implicit routing knowledge into explicit product behavior.

It would improve:

  • consistency
  • safety
  • explainability
  • responsiveness
  • operator ergonomics

MVP suggestion

Start with a read-only planner that outputs:

  • mode
  • reason
  • recommended tools
  • skill to load
  • whether confirmation is required

Even that would already reduce a lot of hidden routing complexity.

extent analysis

Fix Plan

To implement a unified execution planner in OpenClaw, follow these steps:

  • Create a new planning layer that classifies tasks before execution
  • Define a data structure to hold the planning result, such as the proposed JSON shape:
{
  "mode": "direct",
  "reason": "simple local lookup",
  "risk": "low",
  "recommended_tools": ["read", "exec"],
  "skill_to_load": null,
  "requires_confirmation": false,
  "channel_policy": "reply_in_current_chat"
}
  • Implement a decision tree or similar logic to determine the planning result based on task kind, risk level, expected duration, and execution target
  • Integrate the planner with the existing execution pipeline, so that it runs automatically before execution
  • Add support for user override and agent reroute when the task scope expands

Example code in Python:

import json

class ExecutionPlanner:
    def __init__(self, task):
        self.task = task

    def plan(self):
        # Determine planning result based on task kind, risk level, etc.
        if self.task["kind"] == "question":
            return {
                "mode": "direct",
                "reason": "simple local lookup",
                "risk": "low",
                "recommended_tools": ["read", "exec"],
                "skill_to_load": None,
                "requires_confirmation": False,
                "channel_policy": "reply_in_current_chat"
            }
        elif self.task["kind"] == "multi-file code task":
            return {
                "mode": "subagent",
                "reason": "multi-file coding task",
                "recommended_tools": ["sessions_spawn"],
                "skill_to_load": "coding-agent",
                "requires_confirmation": False,
                "channel_policy": "reply_in_current_chat"
            }
        # Add more conditions and planning results as needed

    def execute(self):
        plan = self.plan()
        # Execute the task based on the planning result
        if plan["mode"] == "direct":
            # Execute the task directly
            pass
        elif plan["mode"] == "subagent":
            # Execute the task using a subagent
            pass
        # Add more execution logic as needed

# Example usage:
task = {
    "kind": "question",
    "risk_level": "low",
    "expected_duration": "seconds"
}
planner = ExecutionPlanner(task)
plan = planner.plan()
print(json.dumps(plan, indent=4))

Verification

To verify that the fix worked, test the execution planner with different task kinds, risk levels, and expected durations, and ensure that it produces the correct planning result and executes the task accordingly.

Extra Tips

  • Start with a read-only planner and gradually add more features and complexity as needed
  • Use a decision tree or similar logic to determine the planning result, to make

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…

FAQ

Expected behavior

The planner should ideally:

  1. run automatically before execution
  2. stay invisible for obvious cases
  3. become visible when the route is ambiguous or high-risk
  4. support user override
  5. support agent reroute when task scope expands

Examples:

  • simple local lookup → direct
  • multi-file code task → subagent
  • explicit “use codex / claude code / gemini” → acp
  • external write action → confirm-first

Still need to ship something?

×6

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

Back to top recommendations

TRENDING