Skip to content

[codex] Refactor primary HTTP Effect service#3205

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-web-primary-http
Jun 20, 2026
Merged

[codex] Refactor primary HTTP Effect service#3205
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-web-primary-http

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • inline the PrimaryEnvironmentHttpClient service contract and remove the standalone shape type
  • expose the implementation through the canonical layer export
  • consume the local service module through a namespace import in the web runtime

Impact

This is a structural Effect-service cleanup with no intended user-facing behavior change. The primary HTTP target continues to resolve when the layer is built, so runtime configuration is not captured at module load.

Validation

  • existing primary-environment suite: 3 files, 11 tests passed
  • vp check
  • vp run typecheck

Note

Low Risk
Export and typing refactor only; deferred URL resolution via Effect.suspend is unchanged, so runtime HTTP behavior should stay the same.

Overview
Structural cleanup for the primary environment HTTP Effect service with no intended behavior change.

In httpClient.ts, the standalone PrimaryEnvironmentHttpClientShape alias is removed and the service class uses an inlined Effect.Success<ReturnType<typeof makeEnvironmentHttpApiClient>> type. Client construction is factored into a make effect still wrapped in Effect.suspend (so primary URL resolution happens at layer build time), and the live layer is exported as layer instead of primaryEnvironmentHttpClientLive.

runtime.ts switches to a namespace import (* as PrimaryEnvironmentHttpClient) and wires PrimaryEnvironmentHttpClient.layer into ManagedRuntime.make, updating PrimaryHttpEffectRunner / runPrimaryHttp generics to reference PrimaryEnvironmentHttpClient.PrimaryEnvironmentHttpClient.

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

Note

Refactor primary HTTP Effect service to use namespace import and layer export

  • Removes the PrimaryEnvironmentHttpClientShape type alias from httpClient.ts, inlining the type directly into the PrimaryEnvironmentHttpClient service class.
  • Replaces the primaryEnvironmentHttpClientLive export with a layer export constructed via Layer.effect and a local make Effect using Effect.suspend.
  • Updates runtime.ts to use a namespace import (* as PrimaryEnvironmentHttpClient) and references PrimaryEnvironmentHttpClient.layer instead of the removed primaryEnvironmentHttpClientLive.

Macroscope summarized f3496a6.

@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: bb97b0b2-cc45-46ea-8faa-a206c747ef7d

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-service-web-primary-http

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:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge
juliusmarminge marked this pull request as ready for review June 20, 2026 02:06
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea ae3bd597809dfd7771d0898f735d172973d4c1c8
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
App version: 0.1.0
Git commit: 22f72bcea90cf32322a58ccfa665d79de51430a4
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
App version: 0.1.0
Git commit: 5a7182ae66b2070fc19716b30aef093443628423
Update Details Update Permalink
DetailsBranch: pr-3205
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
Git commit: 22f72bcea90cf32322a58ccfa665d79de51430a4
Update Permalink
DetailsBranch: pr-3205
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
Git commit: 22f72bcea90cf32322a58ccfa665d79de51430a4
Update QR

@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Mechanical refactor that reorganizes exports and switches to namespace imports. No runtime behavior changes - the Effect service creation logic remains identical.

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

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/effect-service-web-primary-http branch from bbbd09a to f3496a6 Compare June 20, 2026 02:19
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 02:19

Dismissing prior approval to re-evaluate f3496a6

@juliusmarminge
juliusmarminge merged commit 3b56dc1 into main Jun 20, 2026
15 checks passed
@juliusmarminge
juliusmarminge deleted the codex/effect-service-web-primary-http branch June 20, 2026 03:07
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