Skip to content

fix(desktop): retry shell env probe after timeout - #49268

Open
lazyayuan wants to merge 1 commit into
anomalyco:devfrom
lazyayuan:shell-env-timeout
Open

lazyayuan wants to merge 1 commit into
anomalyco:devfrom
lazyayuan:shell-env-timeout

Conversation

@lazyayuan

Copy link
Copy Markdown

Issue for this PR

Follow-up to #26449.

Type of change

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

What does this PR do?

When the interactive login-shell environment probe exceeds its five-second timeout, Desktop currently falls back directly to the minimal app environment. That can drop Homebrew and user-local paths even though the cheaper login-only probe would succeed.

Retry with -l after an -il timeout, matching the existing fallback for other probe failures. This keeps slow interactive startup files from causing intermittent command not found errors.

How did you verify your code works?

  • npx --yes bun@1.3.14 test src/main/shell-env.test.ts from packages/desktop (6 passed)
  • Reproduced the GUI launch environment with PATH=/usr/bin:/bin:/usr/sbin:/sbin; zsh -lc resolved both uv and ffmpeg
  • Measured zsh -lc at about 0.1 seconds versus 1.2-1.8 seconds for zsh -ilc locally
  • Package typecheck could not run in this checkout because tsgo is not installed

Screenshots / recordings

N/A - no UI changes.

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.

@lazyayuan lazyayuan closed this Sep 16, 2026
@lazyayuan
lazyayuan deleted the shell-env-timeout branch September 16, 2026 03:30
@lazyayuan
lazyayuan restored the shell-env-timeout branch September 16, 2026 04:52
@lazyayuan lazyayuan reopened this Sep 16, 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