Skip to content

chore(deps): upgrade Effect to 4.1.0 - #1956

Merged
Makisuo merged 2 commits into
mainfrom
chore/effect-4.1.0
Oct 30, 2026
Merged

Makisuo merged 2 commits into
mainfrom
chore/effect-4.1.0

Conversation

@Makisuo

@Makisuo Makisuo commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Upgrades effect and every @effect/* package from 4.0.6 to 4.1.0.

What changed

  • Pins: effect and all @effect/* packages to 4.1.0. @yielded/agent goes to beta.191, its first release that supports effect 4.1. The foldkit packages move to 0.170 / 0.29 / 0.15, which require effect ~4.1.0.
  • Patches regenerated against the 4.1.0 tarballs, with hunks placed by exact-anchor edits and every patched file checked with node --check. The HttpApiClient NoInfer<PayloadR> hunk is now upstream, so it is dropped.
  • Temporary alchemy patch. effect 4.1 replaced effect/Crypto with effect/crypto/*, and alchemy 2.0.0-beta.84 still imports the old module. As a result, everything that loads alchemy failed at import: most api/backend/infra/alerting test files and MCP tool registration, which returned 503. The patch ports the merged but unreleased upstream fix (fix: support effect 4.1 alchemy-run/alchemy#2754) to both lib/ and src/, because Bun resolves alchemy's TypeScript source. Delete it when a newer alchemy is released.
  • One code change: the OpenRouter provider now rejects a static tool whose parameters render as an untyped schema (Schema.Struct({})). The Llm.test.ts fixture now uses Tool.make's default empty parameters. Production MCP tools are built with Tool.dynamic from normalized JSON Schema and are not affected.

Verification

  • bun typecheck passes (52/52) and bun run lint passes on the 4.1.0 pins.
  • I compared the documented example outputs between the 4.0.6 and 4.1.0 sources and found no behavior change that affects us.
  • Previously failing files now pass: apps/ai mcp/app.test.ts and platform/Llm.test.ts, apps/alerting scheduled.test.ts, backend AlertsService.test.ts, api v2 alerts.http.test.ts.
  • bun install --frozen-lockfile makes no changes.
  • CI runs the full suite.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Improved AI response streaming so it can complete cleanly when a provider omits expected final usage information.
    • Improved handling of streamed response decoding errors: errors are surfaced after the provider stream ends, while affected content is withheld.
    • Improved request handling and test-runner reliability across supported environments.

Bump effect and every @effect/* package to 4.1.0, @yielded/agent to
beta.191 and foldkit to 0.170 (its packages peer on effect ~4.1.0).

Patches are regenerated against the 4.1.0 tarballs. The HttpApiClient
NoInfer<PayloadR> hunk is upstream now and is dropped.

effect 4.1 replaced effect/Crypto with effect/crypto/*, and alchemy
beta.84 still imports the old module, so every test or command that
loads alchemy failed at import. The alchemy patch ports the unreleased
upstream fix (alchemy-run/alchemy#2754) to lib/ and src/, since Bun
resolves alchemy's source. Drop it once a newer alchemy is released.

The OpenRouter provider now rejects a static tool whose parameters
render as an untyped schema, so the Llm test tool uses Tool.make's
default empty parameters.
@Makisuo Makisuo added the preview:web Deploy a Workers-only PR preview (no ingest/Electric); see docs/pr-previews.md label Oct 30, 2026
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 321749c7-a403-42d7-afee-eb1cf6f62d5b
Commits

Reviewing files that changed from the base of the PR and between d259635 and 05921e4.

Files selected for processing: 1
  • apps/scraper/src/OtlpIngest.test.ts
Walkthrough

This PR upgrades Effect, Foldkit, and Yielded agent dependencies. It updates local patches for Effect 4.1.0, Alchemy, OpenRouter, and Vitest, including changes to stream decoding, OAuth services, and test-adapter behavior.

Changes: Effect 4.1.0 upgrade

Layer / File(s) Summary
Dependency versions and patch configuration
package.json, packages/db/package.json, examples/effect-todo/package.json, apps/ai/package.json, apps/local-ui/package.json, apps/web/package.json, apps/ai/src/platform/Llm.test.ts
Effect packages and overrides move from 4.0.6 to 4.1.0. Foldkit and Yielded agent packages also receive version updates. The root configuration updates Effect patch paths and adds the Alchemy patch. The AI test fixture removes its explicit empty parameters schema.
Effect response-stream decoding
patches/effect@4.1.0.patch
Response decoding failures are deferred until the provider stream ends. Failed and subsequent original parts are withheld from downstream and added to the span-transformer aggregate when present.
Effect route and shared runtime adjustments
patches/effect@4.1.0.patch
Route-handler construction is deferred until the first request and cached. The client payload type uses NoInfer, and the redacted registry is shared across module instances.
OpenRouter terminal stream handling
patches/@effect%2Fai-openrouter@4.1.0.patch
The handler appends a synthetic terminal chunk if no finish part was emitted. The final flush can process that chunk without a usage block.
Vitest adapter timing and abort handling
patches/@effect%2Fvitest@4.1.0.patch
The adapter resolves the current suite when called. When no signal exists, settleOnAbort returns the original promise. The tester's only property resolves when accessed.
Alchemy OAuth and platform services
patches/alchemy@2.0.0-beta.84.patch
OAuth code uses SecureRandom and Digest instead of Crypto. Bun and Node platform layers include Web Crypto implementations for both services.

Priority: Pending latest changes

Estimated code review effort: 4 (Complex) | ~40 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant ProviderStream
  participant streamContent
  participant Aggregate
  participant LanguageModelMake
  ProviderStream->>streamContent: Send response chunks
  streamContent->>LanguageModelMake: Forward successfully decoded parts
  streamContent->>Aggregate: Append failed and subsequent original parts
  ProviderStream-->>streamContent: End provider stream
  streamContent-->>LanguageModelMake: Emit recorded decoding failure
Loading

Possibly related PRs

Suggested reviewers: jeremyfunk

Merge Risk: Minimal · previous review d2596

No actionable merge-blocking issue was established; the change is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the primary change: upgrading Effect and related packages to version 4.1.0.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (10 skipped: 10 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@maple-review-bot

maple-review-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 9/10 · safe to merge
Patched dist code cannot be inspected offline, so the regenerated hunks and the new alchemy patch rest on CI's alchemy harness and full suite; the pins themselves check out.
no findings · tests partial −1 · risk medium

Pins effect and every @effect/* package to 4.1.0, moves foldkit to 0.170 and @yielded/agent to beta.191, regenerates the package patches and adds a temporary alchemy patch for effect's new crypto/* modules. Dependency wiring is consistent and the only app change is a test fixture, so it is safe to merge on a green suite.

  • effect catalog and overrides move to 4.1.0; @yielded/agent to beta.191, foldkit to 0.170
  • patches/effect@4.1.0.patch drops the now-upstream HttpApiClient NoInfer<PayloadR> hunk
  • New patches/alchemy@2.0.0-beta.84.patch ports effect/crypto to alchemy's lib/ and src/
  • Llm.test.ts fixture tool drops its explicit empty Schema.Struct({}) parameters

Before merge

  • Manual · Wait for Workers in workerd (alchemy test harness) and the queued per-package test shards; they are what exercises the new alchemy patch
  • Manual · File a follow-up to delete patches/alchemy@2.0.0-beta.84.patch once alchemy ships the fix past beta.84
What was checked
  • No @effect/* resolution in bun.lock stays on 4.0.x, so no second effect copy remains
  • No app or package imports effect/Crypto; only the new alchemy patch rewrites those imports
  • Static production tools pass Struct parameters (chat/tools.ts:213, security-audit/source.ts:51), so the new untyped-schema rejection reached only the test fixture

d259635 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

One settle tick before each clock adjustment raced the gzip that send
runs on the libuv pool. On a loaded machine the clock moved before the
request timeout was armed, so the stalled-gateway test hung until its
5s budget ran out.
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🍁 Maple PR preview

Note

Preview resources were removed when this pull request closed.

Final commit 05921e4 · View workflow run

@Makisuo
Makisuo deployed to pr-preview October 30, 2026 00:20 — with GitHub Actions Active
@maple-review-bot

maple-review-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge
The only delta since the last review is a scraper test helper that reuses an existing repo idiom and still fails loudly if the fiber never exits.
no findings · tests covered · risk low

Bumps Effect and every @effect/* package to 4.1.0, regenerates the patches and adds a temporary alchemy patch for the effect/crypto move. The follow-up commit makes the scraper's retry and timeout tests advance the test clock until the send fiber exits. Safe to merge.

  • advanceUntilDone replaces the fixed tick count, polling the send fiber per clock step
  • Retry and timeout tests now stop advancing once the fiber has an exit
What was checked
  • Retry policy is two jittered backoffs (~0.5s, 1s), so one 2s step wakes it (apps/scraper/src/retry.ts:7)
  • pollUnsafe() is undefined while running, matching its other uses (apps/alerting/src/scheduled.test.ts:116)
  • Same Effect.repeat({ until, times }) idiom already used (apps/ai/src/platform/model-call-span.test.ts:837)

05921e4 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo deployed to pr-preview October 30, 2026 00:22 — with GitHub Actions Active
@Makisuo
Makisuo merged commit f4f2afe into main Oct 30, 2026
38 checks passed
@Makisuo
Makisuo deleted the chore/effect-4.1.0 branch October 30, 2026 00:28
@Makisuo
Makisuo deployed to pr-preview October 30, 2026 00:28 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
pr-preview — 05921e41 Deployed Oct 30, 2026 by Makisuo via deploy-pr-preview #7749
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview:web Deploy a Workers-only PR preview (no ingest/Electric); see docs/pr-previews.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant