Skip to content

Use more idiomatic Effect APIs in VCS config and diagnostics#2801

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/effect-codebase-idioms-bb24
Draft

Use more idiomatic Effect APIs in VCS config and diagnostics#2801
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/effect-codebase-idioms-bb24

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 25, 2026

What Changed

  • Decode .t3code/vcs.json through Schema.fromJsonString instead of JSON.parse plus manual schema checks.
  • Return Option from VCS config discovery/read failure paths instead of null sentinels.
  • Run the process resource sampler with Duration/Schedule primitives instead of a manual millisecond sleep loop.
  • Added a regression test for invalid VCS config fallback behavior.

Why

These are small, production-path improvements that align the codebase with idiomatic Effect patterns while preserving existing fallback behavior.

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web View Automation 

Note

Use idiomatic Effect APIs in VCS config and diagnostics

  • Replaces the manual JSON.parse + Schema.is guard in VcsProjectConfig.ts with Schema.decodeUnknownEffect and Effect.option for cleaner decode-or-fallback logic
  • Refactors findConfigPath to return Option<string> and readConfiguredKind to return Option values, eliminating nullable returns
  • Replaces the manual forever + sleep loop in ProcessResourceMonitor.ts with Effect.repeat(Schedule.spaced(SAMPLE_INTERVAL))
  • Adds a test case for invalid VCS config JSON, asserting resolveKind falls back to 'auto'

Macroscope summarized 4419ba0.

cursoragent and others added 2 commits May 25, 2026 16:05
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@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 May 25, 2026
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