The opencode crash when the network is unstable #2973

Closed
opened 2026-02-16 17:38:05 -05:00 by yindo · 8 comments
Owner

Originally created by @junmediatek on GitHub (Nov 19, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When the network is unstable, downloading packages via bun may fail, causing opencode to throw exceptions and affect normal usage.

You can add a retry mechanism (default to 3 retries) to the following function for the crash issue.

https://github.com/sst/opencode/blob/45180104fe84e2d0b9d29be0f9f8a5e52d18e102/packages/opencode/src/bun/index.ts#L60

OpenCode version

1.0.77

Steps to reproduce

When using opencode for the first time (with no packages in the local cache), it is easy to throw exceptions if the network is unstable.

Screenshot and/or share link

No response

Operating System

ubuntu 24

Terminal

VSCode remoteSSH

Originally created by @junmediatek on GitHub (Nov 19, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When the network is unstable, downloading packages via bun may fail, causing opencode to throw exceptions and affect normal usage. You can add a retry mechanism (default to 3 retries) to the following function for the crash issue. https://github.com/sst/opencode/blob/45180104fe84e2d0b9d29be0f9f8a5e52d18e102/packages/opencode/src/bun/index.ts#L60 ### OpenCode version 1.0.77 ### Steps to reproduce When using opencode for the first time (with no packages in the local cache), it is easy to throw exceptions if the network is unstable. ### Screenshot and/or share link _No response_ ### Operating System ubuntu 24 ### Terminal VSCode remoteSSH
yindo added the bug label 2026-02-16 17:38:05 -05:00
yindo closed this issue 2026-02-16 17:38:05 -05:00
Author
Owner

@junmediatek commented on GitHub (Nov 19, 2025):

@rekram1-node
Could you check this issue?

@junmediatek commented on GitHub (Nov 19, 2025): @rekram1-node Could you check this issue?
Author
Owner

@rekram1-node commented on GitHub (Nov 19, 2025):

@junmediatek LOL I added that today:
https://github.com/sst/opencode/commit/48e4f2f45d54364a8123d603dbbca7bfe8fcc763

@rekram1-node commented on GitHub (Nov 19, 2025): @junmediatek LOL I added that today: https://github.com/sst/opencode/commit/48e4f2f45d54364a8123d603dbbca7bfe8fcc763
Author
Owner

@rekram1-node commented on GitHub (Nov 19, 2025):

I didn't even see this one.

Anyways, I am about to start bundling more providers out of the box to prevent need for bun install as much. Should also help fix this

@rekram1-node commented on GitHub (Nov 19, 2025): I didn't even see this one. Anyways, I am about to start bundling more providers out of the box to prevent need for bun install as much. Should also help fix this
Author
Owner

@junmediatek commented on GitHub (Nov 20, 2025):

HI @rekram1-node

I think it should add "Installation lock to prevent concurrent installations of the same package" code flow for bun install error issue.

Below is the patch:

index_patch.ts

Could you help to review it?

@junmediatek commented on GitHub (Nov 20, 2025): HI @rekram1-node I think it should add "Installation lock to prevent concurrent installations of the same package" code flow for bun install error issue. Below is the patch: [index_patch.ts](https://github.com/user-attachments/files/23650765/index_patch.ts) Could you help to review it?
Author
Owner

@junmediatek commented on GitHub (Nov 21, 2025):

hi @rekram1-node

Can you check this issue?

@junmediatek commented on GitHub (Nov 21, 2025): hi @rekram1-node Can you check this issue?
Author
Owner

@rekram1-node commented on GitHub (Nov 23, 2025):

@junmediatek I think this was fixed

@rekram1-node commented on GitHub (Nov 23, 2025): @junmediatek I think this was fixed
Author
Owner
@rekram1-node commented on GitHub (Nov 23, 2025): https://github.com/sst/opencode/commit/768c81cdfdda7b4de4c009ce05de7fd112edd81e
Author
Owner

@junmediatek commented on GitHub (Nov 23, 2025):

768c81c

Yes, you are right, this issue has been fixed.
Thank you.

@junmediatek commented on GitHub (Nov 23, 2025): > [768c81c](https://github.com/sst/opencode/commit/768c81cdfdda7b4de4c009ce05de7fd112edd81e) Yes, you are right, this issue has been fixed. Thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2973