fix(desktop): hide Windows selected app subprocesses#31933
Open
hereswilson wants to merge 2 commits into
Open
Conversation
Author
|
Scope correction: I changed this from |
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
9e5e435 to
5024fea
Compare
77808c1 to
1ed250a
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Fixes #31938
Refs #31629
Type of change
What does this PR do?
While checking #31629, I found a related Windows Desktop path: opening a file with a selected app can spawn subprocesses for app resolution or launch. Those subprocesses should use hidden process creation too.
This PR fixes the selected app open path tracked in #31938. It does not claim to fix the shell tool or MCP subprocess path described in #31629.
Desktop subprocess creation for this path now goes through hidden child process helpers. Commands that need stdout or exit status use hidden
execFile; Windows selected app launches use hiddenspawnand resolve after the child starts instead of waiting for the app to exit.Because validating resolved app paths adds cold path work, this PR also keeps valid resolved app paths in a bounded cache, retries stale cached paths once through the resolver, and leaves missing apps uncached. Stale paths, unreadable shims, malformed resolver output, and unresolved
.cmdor.batshims are treated as unresolved instead of launchable.After adding that validation, I found one more stale Windows resolver case worth tightening: when
wherereturns repeated stale paths, the fuzzy fallback scan could read the same directories over and over. The resolver now deduplicates those fallback directories and caps that scan at the app path cache size. The cap is tied toAPP_PATH_CACHE_LIMITso the fallback search uses the same scale as the cache it feeds.macOS and Linux routing is covered by unit tests, but native UX verification was not done on those OSes. This PR should be reviewed as a Windows selected app launch fix.
How did you verify your code works?
From
packages/desktop:bun test src/main/apps.test.ts src/main/open-path.test.ts src/app-path-cache.test.ts src/main/child-process.test.ts src/renderer/open-path.test.ts --timeout 30000bun typecheckAlso ran the repository push hook through
git push origin hide-windows-spawn; it ranbun turbo typecheckand passed.I also used local benchmark checks around the Windows stale resolver path. The repeated stale directory case dropped from about p50 781ms to p50 39ms after deduping and bounding the fallback scan. A local cap sweep showed scan cost rises with the cap, so the fallback limit now follows the existing app path cache limit rather than using an unrelated number.
Screenshots / recordings
N/A. This changes Windows subprocess launch behavior, not persistent app UI.
Checklist