fix(tasks): auto-wake assignee online on assignment/in_progress#302
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the backend task-mutation notification flow so that when a task is assigned or first enters in_progress, Mission Control best-effort “wakes” the assignee by committing an online heartbeat and recording activity events, reducing cases where the UI shows an assignee as offline during active work.
Changes:
- Add
_wake_agent_online_for_task(...)to commit anonlineheartbeat and record wake success/failure activity. - Invoke the wake helper during assignment notifications and when transitioning into
in_progresswith an assignee. - Add new activity events:
task.assignee_wokenandtask.assignee_wake_failed.
|
Addressed review feedback in commit ✅ Changes made
🔎 Manual verification
|
The _lead_apply_status gate was too strict: it only permitted leads to change task status when the task was already in . This broke the assignment-and-start shortcut introduced in the wake-assignee feature, where a lead assigns a worker and simultaneously sets from . Allow the transition when the lead is also supplying an in the same PATCH. All other non-review status changes remain forbidden. Fixes test_lead_assignment_and_in_progress_wakes_assignee_once.
|
Hi @abhi1693 👋 PR check run #23306147068 is currently Please approve and run workflow for run 23306147068: https://github.com/abhi1693/openclaw-mission-control/actions/runs/23306147068 This is blocking because the latest push (commit |
Summary
This PR makes assignee liveness reflect active task operations.
When a task is assigned or moved into
in_progress, Mission Control now performs a best-effort heartbeat commit (online) for the assignee, so operators do not need manual wake nudges.Closes #301.
Changes
backend/app/api/tasks.py_wake_agent_online_for_task(...)helper._notify_agent_on_task_assign).in_progresswith an assignee (_notify_task_update_assignment_changes).task.assignee_wokentask.assignee_wake_failedWhy
Current behavior can show agents as
offlineeven after assignment / mission start, which is confusing for task operators and makes mission kickoff feel unreliable.Validation
Manual integration validation against local MC stack:
offlinevia heartbeat endpoint.assigned_agent_id=<agent>status=in_progressonlineimmediately after PATCH.Also validated create-task-with-assignee path:
inboxwithassigned_agent_idsetonline.Notes