Skip to content

opencode get stuck when bun add get stuck #4682

@WAY29

Description

@WAY29

Description

What happen:
When I executed opencode, the program froze, akin to a terminal being frozen. I was unable to close it using any method, such as pressing Ctrl+C. When I terminated it from another terminal, I ran it again with the --print-log option and noticed it was stuck at the bun add command. I think we should improve this situation.

I've done some digging and found out why the bun got stuck. It's because my bun encountered a 304 response, and then it just went nowhere. Maybe we should add --no-cache option when run bun.

By the way, I've encountered this error multiple times already; I often have to manually run "bun add."

bun add --cwd /Users/lang/.cache/opencode --force --exact opencode-anthropic-auth@0.0.2 --verbose

bun add v1.3.3 (274e01c7)
   - "opencode-anthropic-auth": "0.0.2" - opencode-anthropic-auth@0.0.2
Enqueue package manifest for download: @openauthjs/openauth
  🔍 Resolving [1/1] [fetch] > HTTP/1.1 GET https://registry.npmmirror.com/@openauthjs%2fopenauth
[fetch] > If-None-Match: W/"e9e873cea576887a9d66bdd1048dbf983cadbe45"
[fetch] > Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.3.3
[fetch] > Host: registry.npmmirror.com
[fetch] > Accept-Encoding: gzip, deflate, br, zstd

[fetch] < 200 Connection established

[fetch] < 304 Not Modified
[fetch] < Server: Tengine
[fetch] < Connection: keep-alive
[fetch] < Strict-Transport-Security: max-age=5184000
[fetch] < Date: Mon, 24 Nov 2025 08:21:49 GMT
[fetch] < request-id: cb00ed85-d034-4a21-b240-036edd52697a
[fetch] < cache-control: public, max-age=300
[fetch] < x-frame-options: SAMEORIGIN
[fetch] < x-xss-protection: 1; mode=block
[fetch] < x-content-type-options: nosniff
[fetch] < x-download-options: noopen
[fetch] < x-readtime: 1.462
[fetch] < Via: cn8360.l1, kunlun1.cn8360, l2cn8047.l2, cache23.l2cn8047, npmmirror-x86-20220823001, cache23.l2cn8047[0,0,304-0,H], cache34.l2cn8047[1,0], kunlun10.cn7632[32,31,304-0,H], kunlun1.cn7632[34,0]
[fetch] < Vary: Origin, Accept, Accept-Encoding
[fetch] < etag: W/"e9e873cea576887a9d66bdd1048dbf983cadbe45"
[fetch] < Age: 45
[fetch] < Ali-Swift-Global-Savetime: 1763972509
[fetch] < X-Cache: HIT TCP_REFRESH_HIT dirn:-2:-2
[fetch] < X-Swift-SaveTime: Mon, 24 Nov 2025 08:22:34 GMT
[fetch] < X-Swift-CacheTime: 255
[fetch] < Timing-Allow-Origin: *
[fetch] < EagleId: 2493171517639725549608795e

OpenCode version

No response

Steps to reproduce

  1. run opencode
  2. get stuck

Screenshot and/or share link

No response

Operating System

macos

Terminal

vscode terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions