🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🔨 chore(userMemories): debug memory workflow keep stucking (#11020)
Neko02a3cc796f61
diff --git a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/batch/route.ts b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/batch/route.tsindex 95277086c34..0339127cdbe 100644--- a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/batch/route.ts+++ b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/batch/route.ts@@ -10,11 +10,22 @@ import { orchestratorWorkflow } from '../workflows';export const { POST } = serve<MemoryExtractionPayloadInput>(async (context) => {const payload = normalizeMemoryExtractionPayload(context.requestPayload || {});- await context.invoke('memory:user-memory:extract:topics:batch', {+ console.log('[chat-topic][batch] Starting batch topic processing workflow', {+ topicIds: payload.topicIds,+ userIds: payload.userIds,+ });++ const { body, isCanceled, isFailed } = await context.invoke('memory:user-memory:extract:topics:batch', {body: context.requestPayload,workflow: orchestratorWorkflow,});+ console.log('[chat-topic][batch] Batch topic processing workflow invoked', {+ body,+ isCanceled,+ isFailed,+ });+return {processedTopics: payload.topicIds.length,processedUsers: payload.userIds.length,diff --git a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/workflows.ts b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/workflows.tsindex 790fea71908..6420075f8b1 100644--- a/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/workflows.ts+++ b/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/workflows/workflows.ts@@ -4,7 +4,6 @@ import { createWorkflow } from '@upstash/workflow/nextjs';import {MemoryExtractionExecutor,type MemoryExtractionPayloadInput,- TOPIC_WORKFLOW_NAMES,normalizeMemoryExtractionPayload,} from '@/server/services/memory/userMemory/extract';@@ -31,6 +30,10 @@ const intersectLayers = (requested: LayersEnum[], allowed: LayersEnum[]) => {export const createLayerWorkflow = (allowedLayers: LayersEnum[]) =>createWorkflow<MemoryExtractionPayloadInput, { processed: number; results: ExtractionResult[] }>(async (context) => {+ console.log('[chat-topic][layer] Starting layer processing workflow', {+ allowedLayers,+ });+const params = normalizeMemoryExtractionPayload(context.requestPayload || {});if (!params.userIds.length) {return { message: 'No user id provided for topic batch.', processed: 0, results: [] };@@ -93,6 +96,8 @@ export const orchestratorWorkflow = createWorkflow<processedIdentity: number;}>(async (context) => {+ console.log('[chat-topic][orchestrator] Starting orchestrator workflow');+const params = normalizeMemoryExtractionPayload(context.requestPayload || {});if (!params.userIds.length) {return {@@ -175,8 +180,3 @@ export const orchestratorWorkflow = createWorkflow<processedIdentity: identityIndex - (params.identityCursor ?? 0),};});--// Explicitly set workflow ids to keep context.invoke working even before serveMany assigns them-cepWorkflow.workflowId = TOPIC_WORKFLOW_NAMES.cep;-identityWorkflow.workflowId = TOPIC_WORKFLOW_NAMES.identity;-orchestratorWorkflow.workflowId = TOPIC_WORKFLOW_NAMES.orchestrator;