Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 779a276

Browse files
committed
fix: opencode run timeout
1 parent 829d868 commit 779a276

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

packages/desktop/src/context/sdk.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ export const { use: useSDK, provider: SDKProvider } = createSimpleContext({
1010
const sdk = createOpencodeClient({
1111
baseUrl: props.url,
1212
signal: abort.signal,
13-
fetch: (req) => {
14-
// @ts-ignore
15-
req.timeout = false
16-
return fetch(req)
17-
},
1813
})
1914

2015
const emitter = createGlobalEmitter<{

packages/opencode/src/cli/cmd/tui/context/sdk.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ export const { use: useSDK, provider: SDKProvider } = createSimpleContext({
1010
const sdk = createOpencodeClient({
1111
baseUrl: props.url,
1212
signal: abort.signal,
13-
fetch: (req) => {
14-
// @ts-ignore
15-
req.timeout = false
16-
return fetch(req)
17-
},
1813
})
1914

2015
const emitter = createGlobalEmitter<{

packages/sdk/js/src/client.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ import { type Config } from "./gen/client/types.gen.js"
66
import { OpencodeClient } from "./gen/sdk.gen.js"
77

88
export function createOpencodeClient(config?: Config) {
9+
if (!config?.fetch) {
10+
config = {
11+
...config,
12+
fetch: (req) => {
13+
// @ts-ignore
14+
req.timeout = false
15+
return fetch(req)
16+
},
17+
}
18+
}
19+
920
const client = createClient(config)
1021
return new OpencodeClient({ client })
1122
}

0 commit comments

Comments
 (0)