From c01fbb09f47e52143a3dd157d2df9ba0e341923c Mon Sep 17 00:00:00 2001 From: tusharmagar Date: Tue, 7 Oct 2025 12:46:05 +0800 Subject: [PATCH] External trigger cant be edited so we delete and recreate for this feat: Improve external trigger handling in Copilot - Added validation for editing external triggers, ensuring users are informed that existing triggers must be deleted and recreated for changes. - Updated documentation to clarify the limitations of external trigger modifications. This update enhances user experience by providing clear guidance on managing external triggers within the Copilot interface. --- .../copilot/components/messages.tsx | 26 ++++++++++++++----- .../lib/copilot/copilot_multi_agent_build.ts | 2 ++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/apps/rowboat/app/projects/[projectId]/copilot/components/messages.tsx b/apps/rowboat/app/projects/[projectId]/copilot/components/messages.tsx index 928380d2..6a699f37 100644 --- a/apps/rowboat/app/projects/[projectId]/copilot/components/messages.tsx +++ b/apps/rowboat/app/projects/[projectId]/copilot/components/messages.tsx @@ -112,15 +112,27 @@ function enrich(response: string): z.infer { }; } + const actionPayload = { + action: metadata.action as 'create_new' | 'edit' | 'delete', + config_type: metadata.config_type as 'tool' | 'agent' | 'prompt' | 'pipeline' | 'start_agent' | 'one_time_trigger' | 'recurring_trigger' | 'external_trigger', + name: metadata.name, + change_description: jsonData.change_description || '', + config_changes: result.changes + }; + + if (actionPayload.config_type === 'external_trigger' && actionPayload.action === 'edit') { + return { + type: 'action', + action: { + ...actionPayload, + error: "Editing external triggers isn't supported. Delete the trigger and create a new one with the updated settings—I can take care of that for you if you'd like." + } + }; + } + return { type: 'action', - action: { - action: metadata.action as 'create_new' | 'edit' | 'delete', - config_type: metadata.config_type as 'tool' | 'agent' | 'prompt' | 'pipeline' | 'start_agent' | 'one_time_trigger' | 'recurring_trigger' | 'external_trigger', - name: metadata.name, - change_description: jsonData.change_description || '', - config_changes: result.changes - } + action: actionPayload }; } } catch (e) { diff --git a/apps/rowboat/src/application/lib/copilot/copilot_multi_agent_build.ts b/apps/rowboat/src/application/lib/copilot/copilot_multi_agent_build.ts index d873e7fc..c9d2d19b 100644 --- a/apps/rowboat/src/application/lib/copilot/copilot_multi_agent_build.ts +++ b/apps/rowboat/src/application/lib/copilot/copilot_multi_agent_build.ts @@ -201,6 +201,8 @@ Note: The agents have access to a tool called 'Generate Image'. This won't show Triggers are automated mechanisms that activate your agents at specific times or intervals. Evaluate every user request for automation or event driven tasks. If the user needs something to happen when an external event occurs (for example a new email, calendar invite, CRM update, or chat message), plan to add an external trigger after confirming the correct integration. +IMPORTANT: External triggers cannot be edited once created. If the user wants to change an external trigger, you must explain that the only option is to delete the existing trigger and create a new one with the updated configuration. Always offer to perform the delete-and-recreate workflow for them. + ### Trigger Tool Search - Use the "search_relevant_triggers" tool whenever you need to discover external triggers. Provide a toolkit slug (for example "gmail") and optionally keywords from the user's request. - Do not invent trigger names. Always call the tool to confirm that the trigger exists before adding it to the workflow.