fix(automations): preserve media attachments, execution tracking, and wait-for-reply on AI Agent branch exits
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start in apps/api/src/instagram/services/instagram-automation-runner.service.ts at executeAutomationBranchPath, then trace the queue payload through apps/workers/src/workers/message-worker.ts and apps/workers/src/services/instagram-api.service.ts. Compare the branch dispatch with triggerMatchingAutomations and check how executions resume after a reply. Done when branch DMs send media, appear in execution logs, wait for replies when configured, and can chain to another AI Agent node.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Description
In apps/api/src/instagram/services/instagram-automation-runner.service.ts, executeAutomationBranchPath (lines 1737-1777) handles downstream nodes when an ACTION_AI_AGENT exits to a branch (e.g., VIP, Booked, Default, Exit), but has the following bugs:
-
Media attachments are silently dropped (or skipped when text is empty):
- Line 1752 checks
if (replyText || hasCarousel)and omitsconfig.mediaUrl, so media-only DM nodes are never queued. - Line 1761 hardcodes
messageType: 'TEXT'while placingconfig.mediaTypein a separatemediaTypefield. processSendMessageJob(apps/workers/src/workers/message-worker.ts, lines 16, 57, 81) only readsmessageType, andInstagramApiService.sendMessage(apps/workers/src/services/instagram-api.service.ts, lines 213 & 303) checksmediaUrl && messageType !== 'TEXT'. As a result, images/videos/audio on AI Agent exit branches are silently dropped and only plain text is sent.
- Line 1752 checks
-
Missing
executionId,nodeId, andwaitForReplyAfterSendhandling:backgroundJob.payload(lines 1757-1769) omitsexecutionIdandnodeId. BecauseprocessSendMessageJobgatesExecutionSteplogging and execution completion onif (executionId)(line 288) and resolves the canvas node viajob.data.nodeId(lines 293, 313), branch DMs are invisible in Automation Logs & Analytics.executeAutomationBranchPathalso does not handlewaitForReplyAfterSend, so any downstream nodes after an exit-branch DM will never resume when the user replies.
Expected Behavior
- DM nodes on AI Agent exit branches must send attached media (
IMAGE,VIDEO,AUDIO,FILE) even whenreplyTextis empty. messageTypein theSEND_DMjob payload must reflectconfig.mediaUrl ? (config.mediaType || 'IMAGE') : 'TEXT'.- Branch executions must create/reuse an
AutomationExecution(executionId), includenodeId: actionNode.nodeIdin the job payload, and transition the execution toWAITING(withcurrentNodeId) whenwaitForReplyAfterSendis enabled.
Where to Look
apps/api/src/instagram/services/instagram-automation-runner.service.ts(executeAutomationBranchPath, lines 1737-1777)apps/workers/src/workers/message-worker.ts(processSendMessageJob, lines 12-86, 288-334)apps/workers/src/services/instagram-api.service.ts(sendMessage, lines 213, 303)
Solution / Implementation Guide
- In
executeAutomationBranchPath:- Update the dispatch guard to
if (replyText || hasCarousel || config.mediaUrl). - Set
messageType: config.mediaUrl ? (config.mediaType || 'IMAGE') : 'TEXT'(matchingtriggerMatchingAutomations). - Create (or look up) the
AutomationExecutionrecord for(automation.id, senderId)and passexecutionIdandnodeId: actionNode.nodeIdinbackgroundJob.payload. - If
config.waitForReplyAfterSendis true (and the node has downstreamnextNodeIds), setAutomationExecution.status = 'WAITING'andcurrentNodeId = actionNode.nodeIdso subsequent user replies resume the flow. - Also handle
ACTION_AI_AGENTif an exit branch chains into another AI Agent node.
- Update the dispatch guard to
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 1
- Merge medio
- 6 min
- PR fusionados (30 d)
- 27
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sumamakhan761/tryinstance
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#65 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
sumamakhan761/tryinstance#64 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
sumamakhan761/tryinstance#63 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#62 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#60 ·
Los mantenedores suelen responder en 1 día
Todos los issues de sumamakhan761/tryinstance
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
makecindy/cindy#15342 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
kwitsch/claude-code-plugin-tooling#219 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
no-repo-link tool-submission
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100