Refine mention-triggered wake behavior and self-assign rules
Update agent skill to allow self-assign only on explicit @-mention handoff with PAPERCLIP_WAKE_COMMENT_ID. Enrich wake contextSnapshot with taskId, wakeCommentId, and wakeReason fields so agents can identify mention-triggered runs. Clarify api-reference exception for handoff-by-mention pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -282,11 +282,18 @@ export function issueRoutes(db: Db, storage: StorageService) {
|
||||
heartbeat.wakeup(mentionedId, {
|
||||
source: "automation",
|
||||
triggerDetail: "system",
|
||||
reason: `Mentioned in comment on issue ${id}`,
|
||||
reason: "issue_comment_mentioned",
|
||||
payload: { issueId: id, commentId: comment!.id },
|
||||
requestedByActorType: actor.actorType,
|
||||
requestedByActorId: actor.actorId,
|
||||
contextSnapshot: { issueId: id, commentId: comment!.id, source: "comment.mention" },
|
||||
contextSnapshot: {
|
||||
issueId: id,
|
||||
taskId: id,
|
||||
commentId: comment!.id,
|
||||
wakeCommentId: comment!.id,
|
||||
wakeReason: "issue_comment_mentioned",
|
||||
source: "comment.mention",
|
||||
},
|
||||
}).catch((err) => logger.warn({ err, agentId: mentionedId }, "failed to wake mentioned agent"));
|
||||
}
|
||||
}).catch((err) => logger.warn({ err, issueId: id }, "failed to resolve @-mentions"));
|
||||
@@ -504,11 +511,18 @@ export function issueRoutes(db: Db, storage: StorageService) {
|
||||
heartbeat.wakeup(mentionedId, {
|
||||
source: "automation",
|
||||
triggerDetail: "system",
|
||||
reason: `Mentioned in comment on issue ${id}`,
|
||||
reason: "issue_comment_mentioned",
|
||||
payload: { issueId: id, commentId: comment.id },
|
||||
requestedByActorType: actor.actorType,
|
||||
requestedByActorId: actor.actorId,
|
||||
contextSnapshot: { issueId: id, commentId: comment.id, source: "comment.mention" },
|
||||
contextSnapshot: {
|
||||
issueId: id,
|
||||
taskId: id,
|
||||
commentId: comment.id,
|
||||
wakeCommentId: comment.id,
|
||||
wakeReason: "issue_comment_mentioned",
|
||||
source: "comment.mention",
|
||||
},
|
||||
}).catch((err) => logger.warn({ err, agentId: mentionedId }, "failed to wake mentioned agent"));
|
||||
}
|
||||
}).catch((err) => logger.warn({ err, issueId: id }, "failed to resolve @-mentions"));
|
||||
|
||||
Reference in New Issue
Block a user