@workflow/core 5.6.0 → 5.6.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.
@@ -76,6 +76,24 @@ export declare const FRAMED_STREAM_MAX_RECONNECTS = 50;
76
76
  * with legitimate long-lived streams.
77
77
  */
78
78
  export declare const FRAMED_STREAM_MAX_TOTAL_RECONNECTS = 1000;
79
+ /**
80
+ * Consecutive live-read sessions that may end without receiving any bytes while
81
+ * the stream's metadata reports a chunk at the resume index, before the read
82
+ * fails. Such a session is not waiting for new data: the chunk is known to
83
+ * exist but was not served, so the index is a hole (the chunk is missing from
84
+ * storage) and reconnecting from it can never make progress. Each stalled
85
+ * session typically lasts the server's maximum response duration, so the
86
+ * general reconnect budget alone would stall a reader for over an hour.
87
+ */
88
+ export declare const FRAMED_STREAM_MAX_STALLS_BELOW_TAIL = 3;
89
+ /**
90
+ * Shortest zero-byte session that counts as a stall below the tail. A session
91
+ * at a hole stays open until the server's maximum response duration (about two
92
+ * minutes on world-vercel). One that ends sooner is a transport blip: it is
93
+ * retried against the general reconnect budget as before, and neither counts
94
+ * toward nor resets {@link FRAMED_STREAM_MAX_STALLS_BELOW_TAIL}.
95
+ */
96
+ export declare const FRAMED_STREAM_MIN_STALL_SESSION_MS = 10000;
79
97
  /**
80
98
  * Wraps the length-prefix-framed byte stream from `world.streams.get` with
81
99
  * transparent auto-reconnect.
@@ -99,6 +117,14 @@ export declare const FRAMED_STREAM_MAX_TOTAL_RECONNECTS = 1000;
99
117
  * trusted (legacy behavior) rather than failing a read that may well be
100
118
  * complete.
101
119
  *
120
+ * A session that stays open for at least `FRAMED_STREAM_MIN_STALL_SESSION_MS`
121
+ * and ends without receiving any bytes while the metadata reports a chunk at
122
+ * the resume index is a stall at a hole (a chunk missing from storage). After
123
+ * `FRAMED_STREAM_MAX_STALLS_BELOW_TAIL` consecutive stalls the read errors
124
+ * with a `StreamError` naming the missing index, so the consumer can resume
125
+ * past it with `startIndex` instead of waiting indefinitely. The reader never
126
+ * skips the hole itself: silently dropping a chunk can corrupt consumer state.
127
+ *
102
128
  * Negative `startIndex` values (last-N semantics) skip the reconnect
103
129
  * machinery because we cannot compute an absolute resume position without
104
130
  * a tail-index lookup; the returned stream behaves as a single-shot read.