@mastra/observability 1.14.4-alpha.0 → 1.14.4-alpha.1

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
@@ -1864,9 +1864,19 @@ var ModelSpanTracker = class {
1864
1864
  };
1865
1865
  }
1866
1866
  /**
1867
- * Report an error on the generation span
1867
+ * Report an error on the generation span, also closing any still-open
1868
+ * MODEL_INFERENCE / MODEL_STEP children so a fatal error before step-finish
1869
+ * doesn't leave them dangling. No-op if they were already closed.
1868
1870
  */
1869
1871
  reportGenerationError(options) {
1872
+ if (this.#currentInferenceSpan) {
1873
+ this.#currentInferenceSpan.error({ error: options.error, endSpan: true });
1874
+ this.#currentInferenceSpan = void 0;
1875
+ }
1876
+ if (this.#currentStepSpan) {
1877
+ this.#currentStepSpan.error({ error: options.error, endSpan: true });
1878
+ this.#currentStepSpan = void 0;
1879
+ }
1870
1880
  this.#modelSpan?.error(options);
1871
1881
  }
1872
1882
  /**