Monitored Subtask Execution
Agent Buildingmonitored-subtask-executionMonitored Subtask Execution is an Agent Skill for agent building published in the RoboClaw-Robotics/RoboClaw repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Monitored single-subtask execution workflow. Use the repository MCP service `corobot_mcp_server` to start, monitor, stop, and reset one prompt-driven robot rollout through the sequence `set_evaluate_params`, poll `get_status`, then `stop/reset`. Use this skill whenever a larger workflow needs one repeatable, safe execution unit with timeout handling and deterministic cleanup.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/RoboClaw-Robotics/RoboClaw/blob/HEAD/skills/monitored-subtask-execution/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/monitored-subtask-execution, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Monitored Subtask Execution
Overview
Use a standardized procedure to call corobot_mcp_server MCP tools and execute one monitored robot subtask. In practice this is one CoRobot PolicyTask run defined by a prompt, an optional policy host/port, and an optional step_interval, followed by deterministic monitoring and cleanup.
Inputs (provide per run)
prompt: task instruction to execute; keep it directly executable and unambiguouspolicy.host / policy.port: optional policy server; if omitted, the service default127.0.0.1:8001is usedstep_interval: optional step interval; service default is1.5timeout_s: maximum time to wait for this runpoll_interval_s: interval for pollingget_status, for example0.5to2.0reset_after: whether to callreset_taskafter completion and return to the home pose; collection workflows usually wanttruemax_retries: number of retries after failure; usually0to2
Tools (MCP)
Core tools, named as {service_name}___{tool_name}:
corobot_mcp_server___set_evaluate_params: set the prompt, policy, andstep_interval, then auto-start the task after a short delaycorobot_mcp_server___get_status: retrieve PolicyTask status to determine running, success, or failure statecorobot_mcp_server___stop_task: stop the current task; prefer this before manual interventioncorobot_mcp_server___reset_task: stop and reset the robot to the initial pose
Optional tools, usually not needed:
corobot_mcp_server___start_task: explicit start; usually unnecessary becauseset_evaluate_paramsalready auto-startscorobot_mcp_server___get_prompt/corobot_mcp_server___set_prompt: inspect or set the current prompt
For exact argument structure, see references/mcp-tool-map.md.
Quick Actions
Hard reset (no prompt)
When no prompt should be executed and you only need to return the robot to a reusable start state:
- Call
corobot_mcp_server___stop_taskif a task might still be running. - Call
corobot_mcp_server___reset_task.
Workflow: Execute One Subtask (single prompt)
Step 0: Safety + Preconditions
- Confirm the robot workspace is safe, emergency stop is available, and human intervention is possible.
- Confirm the MCP service is enabled and reachable.
corobot_mcp_serveris configured insrc/agent_demo/config/ormcp_services.json. - Decide whether this run should preserve its terminal state or return to a reusable start state:
- If only the action result matters, use
reset_after=false. - If the next round needs a reusable start state, use
reset_after=true.
Step 1: Start (set params + auto-start)
Call corobot_mcp_server___set_evaluate_params.
Argument template:
{
"evaluate_params": {
"policy": {"host": "127.0.0.1", "port": 8001},
"prompt": "<prompt>",
"step_interval": 1.5
}
}
Important behavior:
- On success,
set_evaluate_paramswaits briefly and auto-callsstart_task. Do not callstart_taskagain unless you have a specific reason.
Step 2: Monitor (poll get_status with a timeout)
- Poll
corobot_mcp_server___get_statuseverypoll_interval_suntil one of these conditions is met: - the returned status clearly indicates completion, success, or failure
timeout_sis reached- behavior becomes unsafe or manual intervention is required
- Save the raw status text from each poll as a log record even if it cannot be parsed into a structured schema.
Step 3: Handle success / failure deterministically
Success path:
- If
reset_after=true, callcorobot_mcp_server___reset_task. - Record the run metadata:
prompt,policy host/port,step_interval, start time, end time, and final status text.
Failure, timeout, or uncertain-status path:
- Call
corobot_mcp_server___stop_task. - Call
corobot_mcp_server___reset_task. - Record the failure reason, including timeout, connection failure, malformed status, or manual intervention.
- If
max_retriesallows another attempt, return to Step 1. Otherwise mark the run as failed and exit.
Troubleshooting
- If the result indicates a CoRobot connection failure or request failure, verify that the local CoRobot HTTP service is reachable at
http://localhost:8765and that the robot control stack is healthy. - If the task gets stuck, follow the failure path
stop_task -> reset_task. Pause and restore the environment manually if needed.
References
references/mcp-tool-map.md:corobot_mcp_servertool list, naming rules, and argument structure