Distinguish top-level review wakes from subtask completion

Top-level tasks submitted to in_review fired the same
subtask_completed wake as the subtree leaves, so the reviewer's
prompt framed the work as "a subtask you delegated". Add a dedicated
task_review_requested wake reason with a reviewer-specific title and
step list, and route the parent-less branch of the task PATCH handler
through it.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-19 19:26:05 -04:00
1 parent 8bf480236f
commit 2e60ecc0e0
4 files changed
+21 -3

No files matched your search

+5 -1
View File
@@ -229,9 +229,13 @@ export function registerTaskRoutes(server: AgentApiServer) {
);
}
} else {
// Top-level task submission goes to the assignee's manager.
// This is not a subtask — use a distinct wake reason so the
// reviewer prompt does not misframe the work as "a subtask
// you delegated".
const chain = db.getChainOfCommand(token.agentId);
if (chain.length > 0) {
onWakeAgent(chain[0].id, task.companyId, "subtask_completed");
onWakeAgent(chain[0].id, task.companyId, "task_review_requested");
}
}
}