[codex] Preserve desktop shell environment probe failures#3383
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: 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>
Dismissing prior approval to re-evaluate dab1a98
Summary
Verification
vp test apps/desktop/src/shell/DesktopShellEnvironment.test.ts(7 passed)vp check(passes; 20 existing warnings)vp run typecheckNote
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.
runCommandOutputnow tags each probe (login-shell,launchctl-path, PowerShell variants), maps spawn failures toDesktopShellEnvironmentCommandError, and timeouts toDesktopShellEnvironmentCommandTimeoutError. Both are logged as warnings withcomponent: desktop-shell-environmentand 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
DesktopShellEnvironmentCommandErrorandDesktopShellEnvironmentCommandTimeoutErrortagged error classes inDesktopShellEnvironment.tsto capture probe id, executable basename, argument count, and cause without leaking raw error details.runCommandOutputto map spawn failures and timeouts into these errors, log a warning vialogShellEnvironmentCommandError, and return an empty string — replacing the previous silentorElseSucceedrecovery.DesktopShellEnvironment.test.tsto simulate spawn failures and verify that warnings are logged correctly.Macroscope summarized dab1a98.