Redact deleted issue comments

This commit is contained in:
Dotta
2026-06-03 17:32:25 +00:00
parent 78dc3625ac
commit 7f70759e61
27 changed files with 20722 additions and 83 deletions
+2
View File
@@ -28,6 +28,7 @@ const ACTIVITY_ROW_VERBS: Record<string, string> = {
"issue.released": "released",
"issue.comment_added": "commented on",
"issue.comment_cancelled": "cancelled a queued comment on",
"issue.comment_deleted": "deleted a comment on",
"issue.attachment_added": "attached file to",
"issue.attachment_removed": "removed attachment from",
"issue.document_created": "created document for",
@@ -89,6 +90,7 @@ const ISSUE_ACTIVITY_LABELS: Record<string, string> = {
"issue.released": "released the issue",
"issue.comment_added": "added a comment",
"issue.comment_cancelled": "cancelled a queued comment",
"issue.comment_deleted": "deleted a comment",
"issue.feedback_vote_saved": "saved feedback on an AI output",
"issue.attachment_added": "added an attachment",
"issue.attachment_removed": "removed an attachment",
+9 -3
View File
@@ -408,14 +408,20 @@ function createCommentMessage(args: {
followUpRequested: comment.followUpRequested === true,
presentation: comment.presentation ?? null,
commentMetadata: comment.metadata ?? null,
deletedAt: comment.deletedAt ? toDate(comment.deletedAt).toISOString() : null,
deletedByType: comment.deletedByType ?? null,
deletedByAgentId: comment.deletedByAgentId ?? null,
deletedByUserId: comment.deletedByUserId ?? null,
deletedByRunId: comment.deletedByRunId ?? null,
};
const contentText = comment.deletedAt ? "" : comment.body;
if (isSystemNotice) {
const message: ThreadSystemMessage = {
id: comment.id,
role: "system",
createdAt,
content: [{ type: "text", text: comment.body }],
content: [{ type: "text", text: contentText }],
metadata: { custom },
};
return message;
@@ -426,7 +432,7 @@ function createCommentMessage(args: {
id: comment.id,
role: "assistant",
createdAt,
content: [{ type: "text", text: comment.body }],
content: [{ type: "text", text: contentText }],
status: { type: "complete", reason: "stop" },
metadata: createAssistantMetadata(custom),
};
@@ -437,7 +443,7 @@ function createCommentMessage(args: {
id: comment.id,
role: "user",
createdAt,
content: [{ type: "text", text: comment.body }],
content: [{ type: "text", text: contentText }],
attachments: [],
metadata: { custom },
};