Skip to content

fix(cli): widen slow update probes and report failures - #51690

Closed
Veld101 wants to merge 1 commit into
anomalyco:devfrom
Veld101:fix-update-probe
Closed

Veld101 wants to merge 1 commit into
anomalyco:devfrom
Veld101:fix-update-probe

Conversation

@Veld101

@Veld101 Veld101 commented Sep 27, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #51604

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

opencode update skipped an available update with "installation method not found" on a Windows npm install. Detection runs five package-manager probes concurrently and every probe had a fixed 10 second budget; a probe that timed out was folded into the same empty result as a probe that found nothing:

exec(check.command).pipe(
  Effect.orElseSucceed(() => ({ code: 1, stdout: "", stderr: "" })),

So a slow probe was indistinguishable from "not installed", detection returned no method, and the only trace was update skipped: installation method not found. The timings in the report line up with this: five probes start together, the run gives up about eleven seconds later, and an immediate retry completes the same five probes in about two seconds.

Two changes:

  • Probes now get a 30 second budget on Windows instead of 10. npm under nvm4w can be slow to answer on a cold start, which is the reported environment.
  • A probe that errors is now kept as an error rather than an empty result, and every probe's outcome (matched, exit code, or the failure detail) is logged when no method is detected. evaluateProbes holds the selection and the report, so both are unit tested.

I cannot prove the timeout is the whole story: I could not reproduce the slow probe, and npm list -g --depth=0 @opencode/cli answers in about 1.5 seconds on my machine. The logging is what will confirm it — the next occurrence will say which probe missed and whether it timed out. That is the part of the report I could act on with evidence; the longer budget is the part the report explicitly suggested.

How did you verify your code works?

  • bun test src/services/updater.test.ts from packages/cli — 16 pass, including four new evaluateProbes tests (first match wins, a probe that never produced output is not selected, Vite+ requires an exact name instead of a substring, and the report lists exit codes when nothing matches).
  • Confirmed the new tests fail without the source change (Export named 'evaluateProbes' not found).
  • bun typecheck from packages/cli — clean.
  • bun run check from the repository root fails at @opencode/app#typecheck with src/custom-elements.d.ts(1,1): error TS1128, which is pre-existing on this Windows checkout and untouched here. packages/cli itself passes.

Two pre-existing failures I want to be explicit about, both confirmed on a clean tree with this change stashed: packages/cli/test/upgrade.test.ts and the acp * subprocess tests time out at their 5 second budget on this machine, because booting the CLI as a subprocess is slower than that here. They are not related to this change.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

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

@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:20
opencode update skipped an available update on Windows when a package manager was slow to answer. Each probe had a fixed 10 second budget and a probe that timed out was folded into the same empty result as a probe that found nothing, so the failure left no trace.

Probes now get 30 seconds on Windows, and every probe outcome (matched, exit code, or the failure detail) is logged when no method is detected. evaluateProbes holds the selection and the report so both are unit tested.
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: update skipped - installation method not found on Windows npm install

1 participant