@flutchai/flutch-sdk 0.2.19 → 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.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5362,11 +5362,11 @@ exports.LangGraphEngine = class LangGraphEngine {
|
|
|
5362
5362
|
* Extract trace from accumulator and send to backend webhook
|
|
5363
5363
|
* Called in finally block to ensure trace is sent even on errors
|
|
5364
5364
|
*/
|
|
5365
|
-
async sendTraceFromAccumulator(acc,
|
|
5365
|
+
async sendTraceFromAccumulator(acc, preparedPayload, error) {
|
|
5366
5366
|
try {
|
|
5367
5367
|
const { trace } = this.eventProcessor.getResult(acc);
|
|
5368
|
-
|
|
5369
|
-
|
|
5368
|
+
const context = preparedPayload.config?.configurable?.context || preparedPayload.configurable?.context;
|
|
5369
|
+
if (trace && trace.events.length > 0 && context) {
|
|
5370
5370
|
this.logger.debug("[TRACE-WEBHOOK] Sending trace events batch", {
|
|
5371
5371
|
messageId: context.messageId,
|
|
5372
5372
|
totalEvents: trace.totalEvents,
|
|
@@ -5393,8 +5393,8 @@ exports.LangGraphEngine = class LangGraphEngine {
|
|
|
5393
5393
|
this.logger.debug("[TRACE-WEBHOOK] Skipping webhook", {
|
|
5394
5394
|
hasTrace: !!trace,
|
|
5395
5395
|
traceEvents: trace?.events?.length || 0,
|
|
5396
|
-
hasContext: !!
|
|
5397
|
-
contextKeys:
|
|
5396
|
+
hasContext: !!context,
|
|
5397
|
+
contextKeys: context ? Object.keys(context) : [],
|
|
5398
5398
|
hadError: !!error
|
|
5399
5399
|
});
|
|
5400
5400
|
}
|