Skip to content

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

fix: default comment reassign to last commenter who isn't me

dotta915a3ff3cede
diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx
index a6ac9c76cc..7f98db5ed7 100644
--- a/ui/src/pages/IssueDetail.tsx
+++ b/ui/src/pages/IssueDetail.tsx
@@ -376,10 +376,20 @@ export function IssueDetail() {
}, [agents, currentUserId]);
const currentAssigneeValue = useMemo(() => {
+ // Default to the last commenter who is not "me" so the user doesn't
+ // accidentally reassign to themselves when commenting on their own issue.
+ if (comments && comments.length > 0 && currentUserId) {
+ for (let i = comments.length - 1; i >= 0; i--) {
+ const c = comments[i];
+ if (c.authorAgentId) return `agent:${c.authorAgentId}`;
+ if (c.authorUserId && c.authorUserId !== currentUserId)
+ return `user:${c.authorUserId}`;
+ }
+ }
if (issue?.assigneeAgentId) return `agent:${issue.assigneeAgentId}`;
if (issue?.assigneeUserId) return `user:${issue.assigneeUserId}`;
return "";
- }, [issue?.assigneeAgentId, issue?.assigneeUserId]);
+ }, [issue?.assigneeAgentId, issue?.assigneeUserId, comments, currentUserId]);
const commentsWithRunMeta = useMemo(() => {
const runMetaByCommentId = new Map<string, { runId: string; runAgentId: string | null }>();