Parcourir la source

adding timeout (#7128)

Spoon il y a 1 mois
Parent
commit
32e0b612d9
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      packages/opencode/src/session/system.ts

+ 1 - 1
packages/opencode/src/session/system.ts

@@ -123,7 +123,7 @@ export namespace SystemPrompt {
         .then((x) => "Instructions from: " + p + "\n" + x),
     )
     const foundUrls = urls.map((url) =>
-      fetch(url)
+      fetch(url, { signal: AbortSignal.timeout(5000) })
         .then((res) => (res.ok ? res.text() : ""))
         .catch(() => "")
         .then((x) => (x ? "Instructions from: " + url + "\n" + x : "")),