Skip to content

[codex] Preserve desktop shell environment probe failures#3383

Merged
juliusmarminge merged 2 commits into
mainfrom
codex/desktop-shell-environment-errors
Jun 20, 2026
Merged

[codex] Preserve desktop shell environment probe failures#3383
juliusmarminge merged 2 commits into
mainfrom
codex/desktop-shell-environment-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • keep shell environment probing best-effort while retaining command failure diagnostics
  • log distinct Schema errors for process failures and timeouts with command/args/timeout context
  • preserve the exact platform cause for failed process probes

Verification

  • vp test apps/desktop/src/shell/DesktopShellEnvironment.test.ts (7 passed)
  • vp check (passes; 20 existing warnings)
  • vp run typecheck

Note

Low Risk
Observability-only change around already best-effort probes; successful env hydration behavior is unchanged aside from new warning logs on failure.

Overview
Desktop shell environment probing still fails open (empty output, install continues), but spawn and timeout failures are no longer silent.

runCommandOutput now tags each probe (login-shell, launchctl-path, PowerShell variants), maps spawn failures to DesktopShellEnvironmentCommandError, and timeouts to DesktopShellEnvironmentCommandTimeoutError. Both are logged as warnings with component: desktop-shell-environment and structured fields (probe, executable, argumentCount, full cause or timeoutMs), while the human-readable message stays short and does not embed the raw platform error text.

A test asserts that a failed login-shell probe logs exactly one such error with the expected safe context and preserved cause.

Reviewed by Cursor Bugbot for commit dab1a98. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Log desktop shell environment probe failures with structured error context

  • Adds DesktopShellEnvironmentCommandError and DesktopShellEnvironmentCommandTimeoutError tagged error classes in DesktopShellEnvironment.ts to capture probe id, executable basename, argument count, and cause without leaking raw error details.
  • Updates runCommandOutput to map spawn failures and timeouts into these errors, log a warning via logShellEnvironmentCommandError, and return an empty string — replacing the previous silent orElseSucceed recovery.
  • Extends tests in DesktopShellEnvironment.test.ts to simulate spawn failures and verify that warnings are logged correctly.
  • Behavioral Change: failures that were previously swallowed silently now emit a structured warning log entry before returning empty output.

Macroscope summarized dab1a98.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5da98d87-72d9-40ea-b06f-84801d86ad82

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/desktop-shell-environment-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds structured error logging for shell environment probe failures without changing the actual behavior (failures still return empty strings). The changes improve observability by logging warnings with safe context, and include test coverage for the new logging.

You can customize Macroscope's approvability policy. Learn more.

Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 16:38

Dismissing prior approval to re-evaluate dab1a98

@juliusmarminge juliusmarminge merged commit 5b1b35c into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/desktop-shell-environment-errors branch June 20, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant