@peopl-health/nexus 3.2.4 → 3.2.5-fix
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -775,8 +775,10 @@ class NexusMessaging {
|
|
|
775
775
|
logger.error('[CheckAfter] Error processing messages:', { chatId, error: error.message });
|
|
776
776
|
} finally {
|
|
777
777
|
if (typingInterval) clearInterval(typingInterval);
|
|
778
|
-
this.
|
|
779
|
-
|
|
778
|
+
if (this.activeRequests.get(chatId) === runId) {
|
|
779
|
+
this.processingLocks.delete(chatId);
|
|
780
|
+
this.activeRequests.delete(chatId);
|
|
781
|
+
}
|
|
780
782
|
if (this.abandonedRuns.size > 100) {
|
|
781
783
|
this.abandonedRuns.clear();
|
|
782
784
|
}
|
|
@@ -161,10 +161,12 @@ const replyAssistantCore = async (code, message_ = null, thread_ = null, runOpti
|
|
|
161
161
|
const messagesStart = Date.now();
|
|
162
162
|
const beforeCheckpoint = message_?.createdAt ?
|
|
163
163
|
(message_.createdAt.$date ? new Date(message_.createdAt.$date) : message_.createdAt) : null;
|
|
164
|
-
const lastMessage = await getLastNMessages(code, 1, beforeCheckpoint
|
|
164
|
+
const lastMessage = await getLastNMessages(code, 1, beforeCheckpoint, {
|
|
165
|
+
query: { from_me: false }
|
|
166
|
+
});
|
|
165
167
|
timings.get_messages_ms = Date.now() - messagesStart;
|
|
166
168
|
|
|
167
|
-
if (!lastMessage || lastMessage.length === 0
|
|
169
|
+
if (!lastMessage || lastMessage.length === 0) {
|
|
168
170
|
logger.info('[replyAssistantCore] No relevant data found for this assistant.');
|
|
169
171
|
return null;
|
|
170
172
|
}
|