@flutchai/flutch-sdk 0.2.18 → 0.2.20

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.
package/dist/index.js CHANGED
@@ -5332,11 +5332,11 @@ var LangGraphEngine = class {
5332
5332
  * Extract trace from accumulator and send to backend webhook
5333
5333
  * Called in finally block to ensure trace is sent even on errors
5334
5334
  */
5335
- async sendTraceFromAccumulator(acc, config, error) {
5335
+ async sendTraceFromAccumulator(acc, preparedPayload, error) {
5336
5336
  try {
5337
5337
  const { trace } = this.eventProcessor.getResult(acc);
5338
- if (trace && trace.events.length > 0 && config.configurable?.context) {
5339
- const context = config.configurable.context;
5338
+ const context = preparedPayload.config?.configurable?.context || preparedPayload.configurable?.context;
5339
+ if (trace && trace.events.length > 0 && context) {
5340
5340
  this.logger.debug("[TRACE-WEBHOOK] Sending trace events batch", {
5341
5341
  messageId: context.messageId,
5342
5342
  totalEvents: trace.totalEvents,
@@ -5363,8 +5363,8 @@ var LangGraphEngine = class {
5363
5363
  this.logger.debug("[TRACE-WEBHOOK] Skipping webhook", {
5364
5364
  hasTrace: !!trace,
5365
5365
  traceEvents: trace?.events?.length || 0,
5366
- hasContext: !!config.configurable?.context,
5367
- contextKeys: config.configurable?.context ? Object.keys(config.configurable.context) : [],
5366
+ hasContext: !!context,
5367
+ contextKeys: context ? Object.keys(context) : [],
5368
5368
  hadError: !!error
5369
5369
  });
5370
5370
  }