@peopl-health/nexus 3.2.5-fix → 3.2.6

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.
@@ -19,8 +19,8 @@ const runAssistantAndWait = async ({
19
19
  message = null,
20
20
  runConfig = {}
21
21
  }) => {
22
- if (!thread || !thread.getConversationId()) {
23
- throw new Error('runAssistantAndWait requires a thread with a valid thread_id or conversation_id');
22
+ if (!thread) {
23
+ throw new Error('runAssistantAndWait requires a thread');
24
24
  }
25
25
 
26
26
  if (!assistant) {
@@ -282,9 +282,7 @@ class OpenAIResponsesProvider {
282
282
  promptVersion = null,
283
283
  promptVariables = null
284
284
  } = {}) {
285
- try {
286
- const id = this._ensurethreadId(threadId);
287
-
285
+ try {
288
286
  let input = context || this._convertItemsToApiFormat(additionalMessages);
289
287
  let allToolsExecuted = [];
290
288
  let totalRetries = 0;
@@ -313,7 +311,7 @@ class OpenAIResponsesProvider {
313
311
  const functionCalls = response.output.filter(item => item.type === 'function_call');
314
312
 
315
313
  if (functionCalls.length > 0) {
316
- const { outputs, toolsExecuted } = await handleFunctionCallsUtil(functionCalls, assistant, toolMetadata || { thread_id: id, assistant_id: assistantId });
314
+ const { outputs, toolsExecuted } = await handleFunctionCallsUtil(functionCalls, assistant, toolMetadata || { thread_id: threadId, assistant_id: assistantId });
317
315
 
318
316
  input.push(...response.output);
319
317
  input.push(...outputs);
@@ -327,7 +325,7 @@ class OpenAIResponsesProvider {
327
325
 
328
326
  return {
329
327
  ...finalResponse,
330
- thread_id: id,
328
+ thread_id: threadId,
331
329
  assistant_id: assistantId,
332
330
  object: finalResponse.object || 'response',
333
331
  tools_executed: allToolsExecuted,
@@ -228,7 +228,10 @@ const replyAssistantCore = async (code, message_ = null, thread_ = null, runOpti
228
228
  }
229
229
  }
230
230
 
231
- if (!patientMsg || finalThread.stopped) return null;
231
+ if (!patientMsg || finalThread.stopped) {
232
+ logger.info('[replyAssistantCore] Skipping AI processing', { patientMsg, stopped: finalThread.stopped, code });
233
+ return null;
234
+ }
232
235
 
233
236
  const assistant = getAssistantById(finalThread.getAssistantId(), finalThread);
234
237
  const runStart = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "3.2.5-fix",
3
+ "version": "3.2.6",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",
@@ -84,7 +84,7 @@
84
84
  "@opentelemetry/sdk-trace-node": "1.28.0",
85
85
  "@opentelemetry/semantic-conventions": "1.28.0",
86
86
  "airtable": "^0.12.2",
87
- "aws-sdk": "2.1674.0",
87
+ "aws-sdk": "2.1693.0",
88
88
  "axios": "^1.5.0",
89
89
  "dotenv": "^16.6.1",
90
90
  "moment-timezone": "^0.5.43",