From d8753cda02f41e5c6264effdcfe6accd2778bc62 Mon Sep 17 00:00:00 2001 From: rari404 <138394996+edlsh@users.noreply.github.com> Date: Fri, 2 Jan 2026 12:12:02 -0500 Subject: [PATCH] refactor: use Bun.sleep instead of Promise setTimeout (#6620) --- github/index.ts | 2 +- packages/opencode/src/cli/cmd/auth.ts | 2 +- packages/opencode/src/cli/cmd/github.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/github/index.ts b/github/index.ts index 2dcf6e7548..73378894cd 100644 --- a/github/index.ts +++ b/github/index.ts @@ -281,7 +281,7 @@ async function assertOpencodeConnected() { connected = true break } catch (e) {} - await new Promise((resolve) => setTimeout(resolve, 300)) + await Bun.sleep(300) } while (retry++ < 30) if (!connected) { diff --git a/packages/opencode/src/cli/cmd/auth.ts b/packages/opencode/src/cli/cmd/auth.ts index a5e52dd0e6..f200ec4fe0 100644 --- a/packages/opencode/src/cli/cmd/auth.ts +++ b/packages/opencode/src/cli/cmd/auth.ts @@ -36,7 +36,7 @@ async function handlePluginAuth(plugin: { auth: PluginAuth }, provider: string): const method = plugin.auth.methods[index] // Handle prompts for all auth types - await new Promise((resolve) => setTimeout(resolve, 10)) + await Bun.sleep(10) const inputs: Record = {} if (method.prompts) { for (const prompt of method.prompts) { diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts index 26e0fb73dc..0bda43ea7b 100644 --- a/packages/opencode/src/cli/cmd/github.ts +++ b/packages/opencode/src/cli/cmd/github.ts @@ -348,7 +348,7 @@ export const GithubInstallCommand = cmd({ } retries++ - await new Promise((resolve) => setTimeout(resolve, 1000)) + await Bun.sleep(1000) } while (true) s.stop("Installed GitHub app")