Addressing submit_pm_review, get_or_create_channel_by_slug, and other discrepancies/painpoints of the agents

This commit is contained in:
Renn F
2025-12-24 23:05:26 +01:00
parent 67eac35c68
commit dd1b3394a7
13 changed files with 320 additions and 15 deletions
+30
View File
@@ -51,6 +51,7 @@ from roboco.mcp.tasks.handlers import (
handle_session_get_for_task,
handle_session_link_task,
handle_session_unlink_task,
handle_submit_pm_review,
handle_task_activate,
handle_task_assign,
handle_task_block,
@@ -250,6 +251,35 @@ def _register_core_tools(mcp: FastMCP, client: ApiClient, agent_id: str) -> None
)
return await handle_task_escalate(client, input_data, agent_id)
@mcp.tool()
async def roboco_task_submit_pm_review(
task_id: str, notes: str | None = None
) -> dict[str, Any]:
"""
Submit task directly for PM review.
Use this for tasks that don't follow the standard dev→QA→docs workflow:
- PM validation tasks assigned directly to you
- QA audit tasks (not reviewing dev work)
- Any directly-assigned non-dev work
The task will transition to 'awaiting_pm_review' and the PM
will verify and complete it.
WHEN TO USE:
- You completed a task assigned directly to you (not dev work)
- The task doesn't need QA/docs review
- You want the PM to verify and close it
Args:
task_id: The task UUID to submit
notes: Optional completion notes
Returns:
Task awaiting PM review
"""
return await handle_submit_pm_review(client, task_id, agent_id, notes)
def _register_blocking_tools(mcp: FastMCP, client: ApiClient, agent_id: str) -> None:
"""Register blocking/unblocking/pause tools."""
+2
View File
@@ -13,6 +13,7 @@ from roboco.mcp.tasks.handlers.claim import handle_task_claim
from roboco.mcp.tasks.handlers.lifecycle import (
handle_agent_idle,
handle_docs_complete,
handle_submit_pm_review,
handle_task_cancel,
handle_task_complete,
)
@@ -50,6 +51,7 @@ __all__ = [
"handle_session_get_for_task",
"handle_session_link_task",
"handle_session_unlink_task",
"handle_submit_pm_review",
"handle_task_activate",
"handle_task_assign",
"handle_task_block",
+43
View File
@@ -129,6 +129,49 @@ async def handle_task_complete(
)
async def handle_submit_pm_review(
client: ApiClient, task_id: str, agent_id: str, notes: str | None = None
) -> dict[str, Any]:
"""Handle direct submission for PM review.
For tasks that don't follow the standard dev→QA→docs workflow,
such as PM validation tasks, QA audit tasks, or directly-assigned work.
"""
task, error = await fetch_task_or_error(client, task_id)
if error:
return error
assert task is not None
# Must be in_progress to submit for PM review
current_status = task.get("status")
if current_status != "in_progress":
return format_error_response(
"INVALID_STATE",
f"Cannot submit for PM review - task is '{current_status}', "
"expected 'in_progress'.",
{"current_status": current_status},
)
# Submit to API
payload = {}
if notes:
payload["notes"] = notes
resp = await client.post(f"/tasks/{task_id}/submit-pm-review", json=payload)
if not resp.ok:
return format_error_response(
"SUBMIT_FAILED",
"Failed to submit for PM review",
{"status_code": resp.status_code, "api_error": resp.text},
)
guidance = (
"Task submitted for PM review. The PM will verify and complete the task.\n"
"Call roboco_task_scan to find more work, or roboco_agent_idle if none."
)
return format_task_response(resp.json(), "AWAITING_PM_REVIEW", guidance)
def _validate_task_cancellable(task: dict[str, Any]) -> dict[str, Any] | None:
"""Validate task can be cancelled. Returns error or None."""
current_status = task.get("status")