Skip to content

Ask command effect migration#206

Merged
bmdavis419 merged 17 commits into
mainfrom
cursor/ask-command-effect-migration-7a60
Mar 2, 2026
Merged

Ask command effect migration#206
bmdavis419 merged 17 commits into
mainfrom
cursor/ask-command-effect-migration-7a60

Conversation

@bmdavis419
Copy link
Copy Markdown
Collaborator

@bmdavis419 bmdavis419 commented Mar 2, 2026

Completes the Effect v4 migration by converting all CLI commands and their server-side interactions from Promises to Effects.


Open in Web Open in Cursor 

Greptile Summary

This PR successfully completes the Effect v4 migration by converting all CLI commands and server-side services from Promise-based to Effect-based implementations.

Key Changes:

  • All CLI command handlers now return Effect instead of Promise
  • Client API functions expose both Effect versions (with Effect suffix) and Promise wrappers for compatibility
  • Server services (AgentService, ConfigService, CollectionsService, ResourcesService) now return Effects directly
  • Removed effectFromPromise wrapper in favor of direct Effect usage
  • Added comprehensive check-effectification.ts script to prevent regressions
  • Introduced trackCommand helper to simplify command tracking in cli-app.ts

Migration Pattern:

  • Service methods that previously had both method() and methodEffect() now only expose method() returning Effect, with optional methodPromise() for Promise compatibility
  • Commands use Effect.gen, Effect.tryPromise, and Effect.all for async operations
  • Error handling migrated from try/catch to Effect.fail and Effect.tapError

The effectification check script passes all validations, confirming the migration is complete and consistent.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The migration is comprehensive, systematic, and includes guard checks. All effectification validation checks pass. The pattern is consistent across all changed files, and the migration maintains backward compatibility where needed.
  • No files require special attention

Important Files Changed

Filename Overview
apps/cli/src/commands/ask.ts Migrated from Promise to Effect, now returns Effect directly with proper error handling
apps/cli/src/effect/cli-app.ts Refactored command definitions to use trackCommand helper, removed effectFromPromise wrapper
apps/cli/src/client/index.ts Client functions now expose Effect versions (with Effect suffix) and Promise wrappers for backward compatibility
apps/server/src/agent/service.ts Service methods now return Effects, removed duplicate Effect/Promise method pairs
apps/server/src/config/index.ts Config service methods now return Effects, removed duplicate Effect/Promise method pairs
scripts/check-effectification.ts Added comprehensive checks to ensure Effect migration completeness, guards against regressions
apps/cli/src/commands/repl.ts Migrated to Effect, but uses nested Effect.runPromise within Effect.tryPromise which adds complexity

Last reviewed commit: 8b92a15

cursoragent and others added 14 commits March 2, 2026 00:52
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
Co-authored-by: Ben Davis <bmdavis419@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 2, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
better-context Ready Ready Preview, Comment Mar 2, 2026 6:45am

Request Review

@bmdavis419 bmdavis419 marked this pull request as ready for review March 2, 2026 03:05
@bmdavis419 bmdavis419 merged commit 3ca97f8 into main Mar 2, 2026
4 of 6 checks passed
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.

2 participants