[PR #13287] fix(installation): guard startup package-manager probes with timeout #14595

Open
opened 2026-02-16 18:19:22 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13287

State: open
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13287 **State:** open **Merged:** No --- 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
yindo added the pull-request label 2026-02-16 18:19:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14595