Skip to content

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

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

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

Conversation

@lazyayuan

@lazyayuan lazyayuan commented Sep 16, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #49449

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 [email protected] 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
@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop drops shell environment when interactive probe times out

2 participants