From 457a3eb5556fb9a8478bce87e7d9ece8216fb316 Mon Sep 17 00:00:00 2001 From: LinYushen Date: Mon, 30 Mar 2026 17:59:55 +0800 Subject: [PATCH] feat(agents): add on_comment trigger option to agent triggers UI (#193) The backend already supports on_comment triggers but the frontend was missing the UI to configure them. Adds the "On Comment" trigger type and "Add On Comment" button alongside the existing On Assign and Scheduled options. Co-authored-by: Claude Opus 4.6 (1M context) --- apps/web/app/(dashboard)/agents/page.tsx | 25 +++++++++++++++++++++--- apps/web/shared/types/agent.ts | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/apps/web/app/(dashboard)/agents/page.tsx b/apps/web/app/(dashboard)/agents/page.tsx index 70625205..7fb11efd 100644 --- a/apps/web/app/(dashboard)/agents/page.tsx +++ b/apps/web/app/(dashboard)/agents/page.tsx @@ -11,6 +11,7 @@ import { Wrench, FileText, BookOpenText, + MessageSquare, Timer, Trash2, Save, @@ -30,6 +31,7 @@ import type { AgentStatus, AgentTool, AgentTrigger, + AgentTriggerType, AgentTask, RuntimeDevice, CreateAgentRequest, @@ -820,7 +822,7 @@ function TriggersTab({ setTriggers((prev) => prev.filter((t) => t.id !== triggerId)); }; - const addTrigger = (type: "on_assign" | "scheduled") => { + const addTrigger = (type: AgentTriggerType) => { const newTrigger: AgentTrigger = { id: generateId(), type, @@ -869,18 +871,26 @@ function TriggersTab({
{trigger.type === "on_assign" ? ( + ) : trigger.type === "on_comment" ? ( + ) : ( )}
- {trigger.type === "on_assign" ? "On Issue Assign" : "Scheduled"} + {trigger.type === "on_assign" + ? "On Issue Assign" + : trigger.type === "on_comment" + ? "On Comment" + : "Scheduled"}
{trigger.type === "on_assign" ? "Runs when an issue is assigned to this agent" - : `Cron: ${(trigger.config as { cron?: string }).cron ?? "Not set"}`} + : trigger.type === "on_comment" + ? "Runs when a member comments on the agent's issue" + : `Cron: ${(trigger.config as { cron?: string }).cron ?? "Not set"}`}
@@ -959,6 +969,15 @@ function TriggersTab({ Add On Assign +