Skip to content

The open-source app everyone uses to manage agents at work

fix(server): wake agent when issue status changes from backlog

Matt Van Horn20b171bd1689
diff --git a/server/src/routes/issues.ts b/server/src/routes/issues.ts
index 8d21fe656a..e4035dfcda 100644
--- a/server/src/routes/issues.ts
+++ b/server/src/routes/issues.ts
@@ -575,6 +575,10 @@ export function issueRoutes(db: Db, storage: StorageService) {
}
const assigneeChanged = assigneeWillChange;
+ const statusChangedFromBacklog =
+ existing.status === "backlog" &&
+ issue.status !== "backlog" &&
+ req.body.status !== undefined;
// Merge all wakeups from this update into one enqueue per agent to avoid duplicate runs.
void (async () => {
@@ -592,6 +596,18 @@ export function issueRoutes(db: Db, storage: StorageService) {
});
}
+ if (!assigneeChanged && statusChangedFromBacklog && issue.assigneeAgentId) {
+ wakeups.set(issue.assigneeAgentId, {
+ source: "automation",
+ triggerDetail: "system",
+ reason: "issue_status_changed",
+ payload: { issueId: issue.id, mutation: "update" },
+ requestedByActorType: actor.actorType,
+ requestedByActorId: actor.actorId,
+ contextSnapshot: { issueId: issue.id, source: "issue.status_change" },
+ });
+ }
+
if (commentBody && comment) {
let mentionedIds: string[] = [];
try {