Skip to content

[codex] migrate Effect.fn in apps/server/src/provider/makeManagedServerProvider.ts#1640

Merged
juliusmarminge merged 2 commits intomainfrom
codex/effect-fn-apps-server-src-provider-makemanagedserverprovider
Apr 1, 2026
Merged

[codex] migrate Effect.fn in apps/server/src/provider/makeManagedServerProvider.ts#1640
juliusmarminge merged 2 commits intomainfrom
codex/effect-fn-apps-server-src-provider-makemanagedserverprovider

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 1, 2026

Summary

  • migrate the remaining () => Effect.gen(...) wrapper in apps/server/src/provider/makeManagedServerProvider.ts to Effect.fn
  • keep this PR scoped to a single file as part of the checklist split

Why

  • finish the remaining checklist migrations without batching multiple files into one review
  • keep exact-empty-arg Effect.gen wrappers out of the codebase

Validation

  • bun fmt
  • bun lint
  • packages/shared: bun run test src/DrainableWorker.test.ts
  • apps/server: bun run test src/provider/Layers/EventNdjsonLogger.test.ts src/provider/Layers/ProviderRegistry.test.ts src/provider/Layers/ProviderService.test.ts src/provider/Layers/ProviderAdapterRegistry.test.ts src/keybindings.test.ts src/open.test.ts
  • apps/server: bun run test src/orchestration/projector.test.ts
  • apps/server: bun run test src/orchestration/Layers/OrchestrationEngine.test.ts -t "returns deterministic read models for repeated reads"
  • apps/server: bun run test src/orchestration/Layers/OrchestrationEngine.test.ts -t "archives and unarchives threads through orchestration commands"
  • apps/server: bun run test src/orchestration/Layers/OrchestrationEngine.test.ts -t "streams persisted domain events in order"

Notes

  • validation was run from the completed checklist scratch branch before splitting these per-file PRs
  • bun run test and bun typecheck at the repo root currently fail in apps/web because @effect/atom-react cannot be resolved
  • apps/server still has unrelated pre-existing typecheck failures outside this file

Note

Migrate makeManagedServerProvider to use Effect.fn-based generator functions

Refactors makeManagedServerProvider.ts to use the Effect.fn naming and direct generator style throughout.

  • Converts the main exported factory and the snapshot application logic to named Effect.fn generators.
  • Extracts applySnapshotBase as a named Effect.fn and wraps it in applySnapshot, which handles semaphore acquisition separately.
  • Refactors the refreshSnapshot value into a callable Effect.fn generator; all call sites updated to invoke it as refreshSnapshot().
  • Inlines previously nested Effect.gen initialization directly into the generator body.

Macroscope summarized 55d88a6.


Note

Low Risk
Low risk refactor focused on Effect wrapper/naming changes; main behavior risk is around refreshSnapshot now being invoked as a function, which could affect scheduling if any call site was missed.

Overview
Refactors makeManagedServerProvider to wrap the top-level implementation in Effect.fn("makeManagedServerProvider"), and extracts the snapshot-application and refresh logic into named Effect.fn helpers (e.g. applySnapshotBase, refreshSnapshot) for consistent tracing/naming.

Updates periodic refresh and exposed refresh behavior to call refreshSnapshot() (now a function returning an Effect) rather than treating it as an Effect value, while keeping the same semaphore-guarded snapshot update and PubSub publish flow.

Written by Cursor Bugbot for commit 55d88a6. This will update automatically on new commits. Configure here.

…er.ts

Co-authored-by: codex <codex@users.noreply.github.com>
@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: e36d89cb-b5d6-449c-b496-73438dcdecc0

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/effect-fn-apps-server-src-provider-makemanagedserverprovider

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

@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 1, 2026
@juliusmarminge juliusmarminge marked this pull request as ready for review April 1, 2026 16:00
@juliusmarminge juliusmarminge enabled auto-merge (squash) April 1, 2026 16:00
@juliusmarminge juliusmarminge merged commit c6ff7c0 into main Apr 1, 2026
15 of 16 checks passed
@juliusmarminge juliusmarminge deleted the codex/effect-fn-apps-server-src-provider-makemanagedserverprovider branch April 1, 2026 16:03
gigq pushed a commit to gigq/t3code that referenced this pull request Apr 6, 2026
…erProvider.ts (pingdotgg#1640)

Co-authored-by: codex <codex@users.noreply.github.com>
Chrono-byte pushed a commit to Chrono-byte/t3code that referenced this pull request Apr 7, 2026
…erProvider.ts (pingdotgg#1640)

Co-authored-by: codex <codex@users.noreply.github.com>
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