refactor(automations): migrate workflow assistant to unified chat system#742
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
- Replace dedicated workflow agent actions with unified chatWithAgent mutation - Resolve workflow agent ID dynamically via system agent slug query - Add dual-layer loading state (optimistic + server-reactive isGenerating) - Support file attachments display in automation assistant messages - Add additionalContext passthrough to unified chat mutation - Protect system agents (chat, workflow) from deletion/deactivation - Add getSystemAgentBySlug query for slug-based agent resolution - Enable file preprocessing and publish-on-seed for workflow agent template - Remove obsolete workflow agent files (actions, agent, generate_response)
c428c26 to
daae890
Compare
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR consolidates workflow-specific chat logic into a unified agent chat system. It removes the dedicated Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
Summary
Migrates the workflow assistant from a dedicated agent implementation to the unified chat system, removing ~300 lines of bespoke code and aligning with the shared agent infrastructure.
Changes
Frontend (automation assistant)
chatWithWorkflowAssistantaction with the sharedchatWithAgentmutationgetSystemAgentBySlugqueryisPending) + server-reactive (isGenerating) with safety timeoutFileAttachmentDisplayuseCallbackfor stable referencesBackend (Convex)
getSystemAgentBySlugquery for slug-based agent resolutionadditionalContextthrough the unified chat mutationchat,workflow) from deletion and deactivationfilePreprocessingEnabledandpublishOnSeedon the workflow agent templateWORKFLOW_AGENT_CORE_INSTRUCTIONSinstead of delegation-specific instructionsRemoved
convex/agents/workflow/actions.tsconvex/agents/workflow/agent.tsconvex/agents/workflow/generate_response.tsapp/features/automations/hooks/actions.tsSummary by CodeRabbit
New Features
Improvements