Skip to content
Source
Sign inSign up
pingdotgg/t3code

chore(deps): upgrade Effect to 4.1.2 and alchemy to beta.85 #26833

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/26833/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Effect 4.1 is out (release notes). This PR moves every Effect package from 4.0.5 to 4.1.2 and alchemy from beta.84 to beta.85, and fixes everything 4.1 breaks. Two of those breaks are runtime regressions that the type checker does not catch.

Runtime regressions fixed

  • TLS proxies. HttpServerRequest.toURL no longer reads X-Forwarded-Proto. Behind Tailscale Serve or a tunnel, MCP OAuth metadata would advertise http://, https:// resources would be refused (invalid_target), and DPoP htu checks would fail. A new requestUrl helper (apps/server/src/requestUrl.ts) keeps the 4.0 behavior, and every server toURL call goes through it. The existing McpOAuth tests caught this.
  • PR cache growth. Persistence now stores keys as <storeId>:<key>, which KeyValueStore.layerFileSystem writes to disk as pr-v2%3A<hex>. The PullRequestReadCache cleanup regex no longer matched those files, so the cache directory would have grown without bound. The regex now matches both formats, and a new regression test fails without the fix.

alchemy

alchemy beta.85 ships Effect 4.1 support (alchemy-run/alchemy#2754), so patches/alchemy@*.patch is gone. beta.85 moved alchemy/Test/Vitest into the new @alchemy.run/test package. The relay now imports it from there, and patches/@alchemy.run__test@2.0.0-beta.85.patch carries the vitest → vite-plus/test swap that the old alchemy patch made. @distilled.cloud/* moves to rc.18 to match alchemy.

API migration

  • Crypto. effect/Crypto became effect/crypto/SecureRandom and effect/crypto/Digest. Neither can fail, so some dead orDie/mapError handling is gone. Crypto is no longer part of NodeServices.layer, so the server, CLI, desktop and scripts provide NodeCrypto.layer explicitly. Web and relay use the WebCrypto layers. Mobile keeps an Expo-backed layer because Hermes has no SubtleCrypto.
  • MCP. Tool dependencies are now request-level McpRequest<"Requires", S> markers. toolkitRegistration discharges the handler services with a local McpServer.middleware. McpInvocationContext reaches the existing HTTP auth middleware through layerHttp({ registrations }), which removes the unsafe type assertion. Tests use layerInProcessMcpServer, which is exported from McpHttpServer.ts because the no-raw-mcp-registration lint rule keeps McpServer out of testkits.
  • Smaller changes.
    • NodeSocket.NodeWS moved to @effect/platform-node/NodeWS.
    • SqlClient.make needs a driver ("node:sqlite").
    • ChildProcess args are string | Redacted.
    • Server request methods are typed string; DeviceHubProxy returns 405 for unknown ones.
    • sql.insert takes a non-empty array.
    • Terminal needs size.

An audit of the other 4.1 behavior changes found nothing else affected: ChildProcess shell-syntax rejection, stream chunkSize, FetchHttpClient stream bodies, mixed-version RPC framing and serialization, and sql.in([]). One thing worth knowing: on Windows, realPath now uses fs.realpath.native, so mapped drives resolve to UNC paths.

Verification

  • Typecheck is clean in all 40 packages, including web and desktop.
  • The relay passes all 303 of its tests on alchemy beta.85 with no alchemy patch, and the alchemy CLI loads.
  • vp run check:changed: format, lint, knip and graphql pass, and 4,795 of 4,801 tests in 207 files pass. The 6 failures come from macOS filesystem behavior, not this change:
    • UsageService (2), ServerEnvironment (1) and GitVcsDriverCore's short-worktree-folder test (1) fail on the /var vs /private/var realpath. The first three fail the same way on clean main on this Mac.
    • The 2 DesktopLinuxUrlHandler theme-icon tests write com.t3tools.T3Code.png and com.t3tools.t3code.png side by side, which a case-insensitive APFS volume cannot hold. They cover Linux-only behavior.

Built with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

    1. On hold for alchemy-run/alchemy#2754, which adds Effect 4.1 support upstream. Once an alchemy release includes it, bump alchemy and drop the effect/Crypto hunks from patches/alchemy@*.patch (keep the vite-plus/test Vitest hunk), then mark ready.

    2. On hold for alchemy-run/alchemy#2754, which adds Effect 4.1 support upstream. Once a release ships it, bump alchemy and drop the effect/Crypto hunks from patches/alchemy@*.patch (keep the vite-plus/test Vitest hunk), then mark ready.

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at c768a4c

      Macroscope's review found this PR approvable — This upgrades Effect and Alchemy and adapts crypto wiring, MCP registration, proxy URL handling, and cache cleanup. The changes preserve existing product behavior, with targeted verification and no evident material change to permissions, customer data, or infrastructure resources.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB−13 B (−0.3%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB−13 B (−1.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded21.6 KiB21.6 KiB0 B (0.0%)24.4 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB−11 B (−0.2%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.3 KiB1.2 KiB−11 B (−0.9%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 5b9731c · PR result: c768a4c · Source CI: failure

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. juliusmarminge changed the title

    6. juliusmarminge merged this57cd059

    7. juliusmarminge closed this

Sign in to join this conversation.