Skip to content

fix(desktop): await where.exe output in resolveWindowsAppPath - #26319

Closed
daysus wants to merge 2 commits into
anomalyco:devfrom
daysus:fix/windows-resolve-app-path
Closed

daysus wants to merge 2 commits into
anomalyco:devfrom
daysus:fix/windows-resolve-app-path

Conversation

@daysus

@daysus daysus commented May 8, 2026

Copy link
Copy Markdown

Summary

In v1.14.41, resolveWindowsAppPath was refactored from sync to async but execFilePromise("where", [appName]).toString() was called without await. This returned "[object Promise]" instead of the resolved path, breaking app resolution (resolveAppPath) on Windows.

Root Cause

packages/desktop/src/main/apps.ts:61 — execFilePromise("where", [appName]).toString()

execFilePromise (util.promisify(execFile)) returns a Promise. Calling .toString() before await yields "[object Promise]", so path parsing receives garbage.

Fix

  1. Export resolveWindowsAppPath with injectable runExecFile param for testing
  2. await the result and read stdout properly
  3. Regression test added with mocked execFile

Verification

bun test packages/desktop/src/main/apps.test.ts — 1 pass, 0 fail

Related

Issue #26278 reporter also observed sidecar exiting with code 0 seconds after Windows startup in v1.14.41. That symptom may be separate (utilityProcess.fork sidecar refactor) but this fixes a definite bug in the same release.

Commit authored as "OpenCode Contributor".

opencode and others added 2 commits May 7, 2026 14:51
In v1.14.41, resolveWindowsAppPath was refactored from sync to async
but execFilePromise('where', [appName]).toString() was called without
await, returning the string '[object Promise]' instead of the actual
resolved path. This caused app resolution to always fail on Windows.

Added a test that verifies the fix with a mocked execFile.
@daysus
daysus requested a review from adamdotdevin as a code owner May 8, 2026 09:48
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented May 8, 2026

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.

@daysus daysus mentioned this pull request May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 8, 2026
@github-actions github-actions Bot closed this May 8, 2026
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.

1 participant