Skip to content

fix(installation): guard startup package-manager probes with timeout#13287

Open
ymylive wants to merge 1 commit intoanomalyco:devfrom
ymylive:fix/issue-11657-install-timeout
Open

fix(installation): guard startup package-manager probes with timeout#13287
ymylive wants to merge 1 commit intoanomalyco:devfrom
ymylive:fix/issue-11657-install-timeout

Conversation

@ymylive
Copy link

@ymylive ymylive commented Feb 12, 2026

Fixes #11657

Summary

  • Add a 5s timeout guard around package-manager detection commands in Installation.method()
  • Log and continue when a probe times out/fails, instead of hanging startup
  • Add the same timeout guard to npm config get registry in Installation.latest() with fallback to https://registry.npmjs.org

Why

On some Windows environments, internal npm commands can hang indefinitely when spawned by OpenCode during startup/version checks. That blocks CLI startup with no visible error. This change ensures those checks fail fast and degrade gracefully.

Scope

  • packages/opencode/src/installation/index.ts only
  • No behavior changes for successful probes

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicate found:

Why it might be related: PR #11724 addresses issue #11657, which is the exact same issue referenced in the current PR #13287. Both are related to fixing Windows CLI startup issues. This could indicate an existing PR attempting to solve the same problem.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: opencode CLI hangs at startup when running internal npm list / npm config get registry

2 participants

Comments