@flutchai/flutch-sdk 0.7.3 → 0.7.4

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 CHANGED
@@ -5990,6 +5990,10 @@ exports.LangGraphEngine = class _LangGraphEngine {
5990
5990
  traceEvents: trace?.events?.length || 0,
5991
5991
  hadError: !!streamError
5992
5992
  });
5993
+ if (streamError && isRecursionLimit(streamError) && content?.text?.trim()) {
5994
+ this.logger.warn(`[STREAM-ERROR] Recursion limit reached after the answer was written; returning the answer`);
5995
+ return content;
5996
+ }
5993
5997
  if (streamError) {
5994
5998
  throw streamError;
5995
5999
  }
@@ -6198,6 +6202,10 @@ exports.LangGraphEngine = _ts_decorate22([
6198
6202
  typeof config.ConfigService === "undefined" ? Object : config.ConfigService
6199
6203
  ])
6200
6204
  ], exports.LangGraphEngine);
6205
+ function isRecursionLimit(error) {
6206
+ return error.name === "GraphRecursionError" || /Recursion limit of \d+ reached/.test(error.message);
6207
+ }
6208
+ __name(isRecursionLimit, "isRecursionLimit");
6201
6209
 
6202
6210
  // src/engines/graph-engine.factory.ts
6203
6211
  function _ts_decorate23(decorators, target, key, desc) {