Skip to content

explore further integartion of effect-atom#1618

Draft
juliusmarminge wants to merge 5 commits intomainfrom
effect-atom
Draft

explore further integartion of effect-atom#1618
juliusmarminge wants to merge 5 commits intomainfrom
effect-atom

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 1, 2026

What Changed

Why

UI Changes

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

Note

Replace React Query with Effect atom-backed state for server config, git, and WebSocket RPC

  • Introduces a new WsRpcClient and WsTransport layer that wraps all WebSocket communication as typed Effect RPCs and streams, replacing direct wsNativeApi push-channel listeners with useServerWelcomeSubscription/useServerConfigUpdatedSubscription hooks.
  • Adds @effect/atom-react-backed atoms for server config, git status, branches, mutations (checkout, create branch, worktree, pull, init, PR), and settings; components across ChatView, Sidebar, BranchToolbarBranchSelector, GitActionsControl, DiffPanel, and PullRequestThreadDialog are migrated from React Query to these atoms.
  • Defines a comprehensive rpc.ts contract in packages/contracts with typed WS_METHODS constants and RPC schemas, replacing the old ws.ts push-channel exports.
  • Adds ServerLifecycleEvents and ServerRuntimeStartup services on the server, startup command gating, attachment-serving HTTP routes, and platform-conditional Bun/Node layers.
  • Moves error types (GitCommandError, ServerSettingsError, KeybindingsConfigError, etc.) from local modules into @t3tools/contracts and re-exports them.
  • Risk: onServerWelcome, onServerConfigUpdated, and onServerProvidersUpdated are removed from the public NativeApi; git.onActionProgress subscription is also removed.
📊 Macroscope summarized 054d0a4. 44 files reviewed, 7 issues evaluated, 1 issue filtered, 3 comments posted

🗂️ Filtered Issues

apps/server/src/serverRuntimeStartup.ts — 0 comments posted, 1 evaluated, 1 filtered
  • line 92: On line 92, return yield* readinessState attempts to yield a ServerRuntimeStartupError instance directly, but yield* in Effect generators expects an Effect, not a plain error object. This will cause a runtime error. The correct code should be return yield* Effect.fail(readinessState) to properly fail the effect with the error. [ Failed validation ]

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

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: 0cc75b39-6613-4429-b4ad-be859a1858ab

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 effect-atom

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

@github-actions github-actions bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Apr 1, 2026

private scheduleReconnect() {
if (this.disposed || this.reconnectTimer !== null) {
dispose() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low src/wsTransport.ts:122

dispose() fires Scope.close via Effect.runPromise (the global runtime) and immediately calls this.runtime.dispose() without awaiting the scope closure. Since this.clientScope was created using this.runtime, disposing the runtime while the scope is still finalizing can cause incomplete resource cleanup or runtime errors if the scope's finalization depends on runtime resources. Consider chaining the two operations so the runtime disposal awaits the scope closure.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/wsTransport.ts around line 122:

`dispose()` fires `Scope.close` via `Effect.runPromise` (the global runtime) and immediately calls `this.runtime.dispose()` without awaiting the scope closure. Since `this.clientScope` was created using `this.runtime`, disposing the runtime while the scope is still finalizing can cause incomplete resource cleanup or runtime errors if the scope's finalization depends on runtime resources. Consider chaining the two operations so the runtime disposal awaits the scope closure.

Evidence trail:
apps/web/src/wsTransport.ts lines 122-130 (dispose method), lines 33-38 (constructor showing clientScope created with this.runtime)

- Remove trailing commas from `apps/web/tsconfig.json`
- Keep TypeScript config consistent with project formatting rules
@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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