Skip to content

[codex] Remove redundant Effect type annotations - #3229

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/remove-redundant-effect-type-annotations
Jun 20, 2026
Merged

[codex] Remove redundant Effect type annotations#3229
juliusmarminge merged 1 commit into
mainfrom
codex/remove-redundant-effect-type-annotations

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • remove directly inferred Effect, Layer, ManagedRuntime, and ReturnType annotations
  • keep runtime boundary annotations that TypeScript requires for portable exported types or literal-union preservation
  • make intermediate runtime layers private where only the final runtime is consumed

Validation

  • 68 focused tests across desktop, server, web, client-runtime, and tailscale
  • vp check (20 pre-existing warnings)
  • vp run typecheck
  • vp run lint:mobile

Note

Low Risk
Annotation-only refactor with no runtime behavior changes; exported public types are preserved at API boundaries via explicit layer-source unions.

Overview
This PR strips explicit Effect, Layer, ManagedRuntime, and ReturnType annotations where TypeScript already infers the same types from Effect.gen, Layer.effect, pipes, and similar patterns. Touch points include desktop observability/backend/menu/shell helpers, server MCP and provider registry layers, web DPoP key generation, tailscale status reading, and client-runtime EnvironmentRpc.config.

For web/mobile connection and app runtimes, intermediate composed layers (connectionLayer, runtimeLayer, providedConnectionPlatformLayer) are left unannotated and often non-exported, while exported boundaries (connectionAtomRuntime, runtime, runtimeContextLayer) still declare portable types via ConnectionLayerSource / RuntimeLayerSource unions instead of typeof the final merged layer.

packages/client-runtime drops unused imports tied to removed config typing and relies on inference for config’s return effect type.

Reviewed by Cursor Bugbot for commit 087299a. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Remove redundant explicit type annotations from Effect and Layer declarations

Removes explicit Effect.Effect and Layer.Layer type parameters from utility functions and layer definitions across desktop, mobile, web, server, and package code, relying on TypeScript inference instead.

  • Several internal layers (runtimeLayer, connectionLayer) are un-exported and replaced with inferred type aliases (RuntimeLayerSource, ConnectionLayerSource) used by the exported runtimes and context layers.
  • Unused type-only imports (ServerConfig, ConnectionAttemptError) are removed from packages/client-runtime/src/rpc/client.ts.
  • Risk: connectionLayer and runtimeLayer are no longer exported from the mobile and web runtime modules; any external consumers of these symbols will break.

Macroscope summarized 087299a.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

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: 6a70b39b-e76d-4a1c-9577-7890ec5b4c23

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/remove-redundant-effect-type-annotations

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

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Pure TypeScript type annotation cleanup with no runtime behavior changes. The explicit Effect/Layer type annotations being removed were redundant since TypeScript infers these types automatically.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
juliusmarminge merged commit 9a1c487 into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/remove-redundant-effect-type-annotations branch June 20, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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