Uh oh!
There was an error while loading. Please reload this page.
feat(desktop): complete Effect migration for main process - #330
feat(desktop): complete Effect migration for main process#330charleslpan wants to merge 14 commits into
Conversation
Migrate SessionProviderAdapter, InMemorySessionRegistry.refresh, CompositeSessionProviderAdapter, IssueTrackerAdapter, and AttentionEvaluator from Promise to Effect. Add AttentionRateLimited tagged error and Effect.retry rate-limit handling in SessionAttentionReviewer. Update sidecar-core tests to use Effect.runPromise at boundaries.
Delete effect-runtime.ts; build ManagedRuntime in desktop-app.ts. Inject runRequestEffect into makeHttpLive so http.ts never calls runPromise. Remove runSync/runPromise from account-loopback and google-calendar-oauth timeouts.
…ators SupersetCli/SignIn use Cli and Files. UpdateService and ProductEventSender use singleFlight instead of Promise inFlight. Attention evaluators drop quietUntil in favor of AttentionRateLimited. AccountSessionManager signOut returns Effect; session IPC uses signOutForIpc at the edge.
Wrap cloud and CLI adapter observe/send/control/create calls with runHttpEffect and runCliEffect at the test boundary. Update adapter helpers to use Effect-based readApiKey and remove fetch from constructor options. Fix Cursor repository refresh to use forkDaemon so sidebar reads survive the observation pass.
Extend CliFailure with an optional stderr field so CLI adapters can surface bounded provider error text. Update sidecar-core tests to run Effect-returning mocks through a shared test runner.
Replace broken Ref-based rate-limit quiet windows with instance fields, wire observation-loop through injectable runEffect, extract workspace creation stderr from CliFailure, and align handlers with Effect-returning stores and CLIs.
Wrap Effect-returning service and adapter calls with runLocalEffect, runHttpEffect, and runCliWithFiles helpers. Stabilize async sign-in openExternal assertions and align hosted, OpenAI, and Superset tests with Effect-based APIs.
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bcc4c2c. Configure here.
| this.#options.onChange(this.#account); | ||
| const stored = options.revokeRemote ? yield* this.#options.store.readAccount() : undefined; | ||
| const clearing = yield* this.#options.store.clearAccount(); | ||
| yield* this.#options.stopCapabilities(); |
There was a problem hiding this comment.
Sign-out skips stopping capabilities
High Severity
signOut now waits for clearAccount before stopCapabilities. A store failure leaves the UI already marked signed out while capabilities keep running. Previously clearing was started in parallel and capabilities always stopped first.
Reviewed by Cursor Bugbot for commit bcc4c2c. Configure here.
| const raw = yield* http.readJson(response); | ||
| // SAFETY: OAuth JSON responses match WireBoundaryInput at this HTTP boundary. | ||
| return wireBodyFromJson(raw as WireBoundaryInput); | ||
| }); |
There was a problem hiding this comment.
Failed JSON hides token status
Medium Severity
readOAuthJson parses the body before responseRecord reads response.ok. A 401 with empty or invalid JSON becomes CloudFailure instead of AccountClientFailure with status, so accessTokenNeedsRefresh never treats it as expiry.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit bcc4c2c. Configure here.
| while: (error) => error.failure === CLOUD_FAILURE.TRANSIENT, | ||
| schedule: TRANSIENT_RETRY_SCHEDULE, | ||
| }), | ||
| ); |
There was a problem hiding this comment.
Timed-out cloud fetches keep running
Medium Severity
Cloud reads and writes replaced AbortSignal.timeout with Effect.timeout and retry transient failures twice. The underlying fetch is not aborted, so each timeout can leave a live request and start another, stacking connections during observation.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit bcc4c2c. Configure here.


Summary
Unblocks and completes the Effect migration for the desktop main process and sidecar-core.
Blockers fixed
singleFlightdeadlocked on semaphore + deferred await; linear OAuth tests awaited raw Effects; update-service test calledreleasebefore fetch started.runHttpEffect/runLocalEffect/runCliEffectat test boundaries.action-handlerinjects runtime instead of importingdesktop-appat module load.Notable source fixes
linear-oauth.ts: clear waiting timeout when callback is claimed.account-token-lifecycle.ts: fix single-flight lock scope.#quietUntilRef initialization.observation-loop.ts: remove defaultEffect.orDiefallback.Evidence
./scripts/check.shpass (lint, oxlint, typecheck, 1207 desktop tests, build)./scripts/verify.sh):not run(cloud VM)Automated visual evidence
CI will replace this block with a link to the deterministic macOS screenshots.
Physical-device evidence
not attachednot performednot recordedNotes
./scripts/verify.shon macOS before merge