Skip to content

The opencode crash when the network is unstable #4492

Closed

Description

@junmediatek

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 19, 2025
  2. junmediatek commented on Nov 19, 2025

    @junmediatek
    ContributorAuthor

    @rekram1-node
    Could you check this issue?

  3. rekram1-node commented on Nov 20, 2025

    @rekram1-node
    Contributor

    @junmediatek LOL I added that today:
    48e4f2f

  4. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 20, 2025
  5. self-assigned this
    on Nov 20, 2025
  6. rekram1-node commented on Nov 20, 2025

    @rekram1-node
    Contributor

    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

  7. junmediatek commented on Nov 20, 2025

    @junmediatek
    ContributorAuthor

    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?

  8. junmediatek commented on Nov 21, 2025

    @junmediatek
    ContributorAuthor

    hi @rekram1-node

    Can you check this issue?

  9. rekram1-node commented on Nov 23, 2025

    @rekram1-node
    Contributor

    @junmediatek I think this was fixed

  10. rekram1-node commented on Nov 23, 2025

    @rekram1-node
    Contributor
  11. junmediatek commented on Nov 24, 2025

    @junmediatek
    ContributorAuthor

    768c81c

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions