Skip to content

The open source coding agent.

TypeScript

adding timeout (#7128)

Spoon32e0b612d987
diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts
index 12b6a537eaa..5ab165ba245 100644
--- a/packages/opencode/src/session/system.ts
+++ b/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 : "")),