Skip to content

[codex] Diagnose desktop client settings read failures#3432

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-client-settings-diagnostics
Jun 20, 2026
Merged

[codex] Diagnose desktop client settings read failures#3432
juliusmarminge merged 1 commit into
mainfrom
codex/desktop-client-settings-diagnostics

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Desktop client settings intentionally fall back to None when the settings file is missing or unusable, but the loader previously implemented that behavior with Effect.option and Effect.orElseSucceed. Those broad fallbacks also hid permission failures, other filesystem failures, and malformed settings documents without leaving any diagnostic evidence.

This change keeps the existing nonfatal API while making unexpected failures observable. A normalized PlatformError whose reason is NotFound remains an expected silent absence. Other filesystem failures produce a warning annotated with settingsPath and retain the original platform error in the log arguments. Schema failures likewise produce a path-annotated warning with the original SchemaError before returning None. Both recovery points use tagged catch semantics.

The diagnostics tests use an isolated test file because the established client-settings test is currently touched by feature work. They verify that missing files remain silent, permission failures remain nonfatal but observable, and malformed documents remain nonfatal but observable.

Validation:

  • vp test apps/desktop/src/settings/DesktopClientSettings.diagnostics.test.ts
  • vp check (passes with pre-existing repository warnings only)
  • vp run typecheck

Note

Low Risk
Behavior for callers (get still returns Option) is unchanged except that some previously hidden failures may now surface as Effect failures or logs; no auth or data-mutation paths.

Overview
Desktop client settings still return None when the file is absent or unusable, but unexpected problems are no longer swallowed silently.

readClientSettings replaces broad Effect.option / orElseSucceed fallbacks with tagged handling: NotFound stays a quiet None; other PlatformError cases emit a warning (with settingsPath) and return None; SchemaError on decode gets the same treatment. Errors outside those tags are no longer converted to None.

Adds DesktopClientSettings.diagnostics.test.ts to assert missing file → no logs, permission/read failure → warning + path, malformed JSON → decode warning + path.

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

Note

Diagnose desktop client settings read failures with targeted warning logs

  • Missing settings files return None silently (no log) in readClientSettings.
  • Non-missing filesystem read errors now emit a warning log annotated with settingsPath instead of silently returning None.
  • Schema decode failures now emit a warning log annotated with settingsPath instead of silently returning None.
  • Read or decode errors that are not PlatformError/SchemaError now propagate as failures rather than being swallowed.
  • Adds diagnostic tests in DesktopClientSettings.diagnostics.test.ts covering all three cases above.

Macroscope summarized 295cff2.

@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: 01ecb35f-4319-49ef-b2cb-3b957beb2879

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-client-settings-diagnostics

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

@juliusmarminge juliusmarminge marked this pull request as ready for review June 20, 2026 19:57
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds diagnostic warning logs when desktop client settings fail to read due to unexpected errors (not missing file). The actual behavior is unchanged - errors still result in returning None - but now unexpected failures are logged with the settings path for debugging purposes.

No code changes detected at 295cff2. Prior analysis still applies.

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

@juliusmarminge juliusmarminge force-pushed the codex/desktop-client-settings-diagnostics branch from f596e87 to 46386c2 Compare June 20, 2026 22:42
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/desktop-client-settings-diagnostics branch from 46386c2 to 295cff2 Compare June 20, 2026 22:50
@juliusmarminge juliusmarminge merged commit ad2cb1d into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/desktop-client-settings-diagnostics branch June 20, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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