diff options
| author | Aiden Cline <[email protected]> | 2026-01-01 12:46:25 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2026-01-01 12:46:25 -0600 |
| commit | 8ebc601ea28794da4367e3bf4373bf5c4c7f168e (patch) | |
| tree | b2ec7ca7b26a5a9285865db6ea0ca85b6fb2191c | |
| parent | 7a3ff5b98f5b8fbe69c217daebaef6bccb7d9a2c (diff) | |
| download | opencode-8ebc601ea28794da4367e3bf4373bf5c4c7f168e.tar.gz opencode-8ebc601ea28794da4367e3bf4373bf5c4c7f168e.zip | |
core: use --no-cache when behind proxy to avoid hangs
| -rw-r--r-- | packages/opencode/src/bun/index.ts | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts index 55bbf7b41..fe2f0dec3 100644 --- a/packages/opencode/src/bun/index.ts +++ b/packages/opencode/src/bun/index.ts @@ -73,8 +73,24 @@ export namespace BunProc { }) if (parsed.dependencies[pkg] === version) return mod + const proxied = !!( + process.env.HTTP_PROXY || + process.env.HTTPS_PROXY || + process.env.http_proxy || + process.env.https_proxy + ) + // Build command arguments - const args = ["add", "--force", "--exact", "--cwd", Global.Path.cache, pkg + "@" + version] + const args = [ + "add", + "--force", + "--exact", + // TODO: get rid of this case (see: https://github.com/oven-sh/bun/issues/19936) + ...(proxied ? ["--no-cache"] : []), + "--cwd", + Global.Path.cache, + pkg + "@" + version, + ] // Let Bun handle registry resolution: // - If .npmrc files exist, Bun will use them automatically |
