@oh-my-pi/pi-utils 16.1.10 → 16.1.12

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/fetch-retry.ts +12 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "16.1.10",
4
+ "version": "16.1.12",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@oh-my-pi/pi-natives": "16.1.10",
34
+ "@oh-my-pi/pi-natives": "16.1.12",
35
35
  "handlebars": "^4.7.9",
36
36
  "winston": "^3.19.0",
37
37
  "winston-daily-rotate-file": "^5.0.0"
@@ -169,7 +169,18 @@ export async function fetchWithRetry(
169
169
  for (let attempt = 0; ; attempt++) {
170
170
  if (signal?.aborted) throw new Error("Request was aborted");
171
171
  const requestUrl = typeof url === "function" ? url(attempt) : url;
172
- const init = prepareInit ? mergeInit(baseInit, await prepareInit(attempt), timeout) : baseInit;
172
+ // `timeout` is destructured out of `baseInit`, so forward it to the underlying
173
+ // fetch on the no-`prepareInit` path too. Without this, callers that pass
174
+ // `timeout: false` (every streaming provider, to disable Bun's native ~300s
175
+ // fetch ceiling in favor of their own first-event/idle watchdog) had it
176
+ // silently dropped, so long-running streams were killed at ~300s (issue #602).
177
+ // Only forward when the caller actually set `timeout`, so callers that never
178
+ // set it keep Bun's default ceiling.
179
+ const init = prepareInit
180
+ ? mergeInit(baseInit, await prepareInit(attempt), timeout)
181
+ : "timeout" in options
182
+ ? ({ ...baseInit, timeout } as unknown as RequestInit)
183
+ : baseInit;
173
184
 
174
185
  let response: Response;
175
186
  try {