Skip to content

Use tagged error guards across package copies - #7087

Merged
tim-smart merged 2 commits into
mainfrom
agent/codex-engineer/d854a64d
Aug 6, 2026
Merged

Use tagged error guards across package copies#7087
tim-smart merged 2 commits into
mainfrom
agent/codex-engineer/d854a64d

Conversation

@tim-smart

Copy link
Copy Markdown
Contributor

Summary

  • recognize ConfigProvider.SourceError and RpcClientError structurally across duplicate package copies and module reloads
  • use shared _tag guards for the api-diff error rethrow paths
  • add focused cross-copy regression coverage for Config, RPC, and api-diff tagged errors
  • leave class-identity-based instanceof checks unchanged

Why

Tagged errors created by another copy of a module fail constructor-identity checks. That caused recoverable Config source failures to remain defects and genuine RPC/api-diff errors to be wrapped again.

Validation

  • pnpm vitest run packages/effect/test/Config.test.ts packages/effect/test/rpc/RpcClient.test.ts packages/tools/api-diff/test (180 tests)
  • pnpm --dir packages/effect check
  • pnpm --dir packages/tools/api-diff check
  • pnpm lint

Closes EFF-528
Closes EFF-529
Closes EFF-530
Closes EFF-531

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4e5215a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
effect Patch
@effect/ai-anthropic Patch
@effect/ai-openai Patch
@effect/ai-openai-compat Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/openapi-generator Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node Patch
@effect/platform-node-shared Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/vitest Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-slopcop effect-slopcop Bot added 4.0 bug Something isn't working labels Aug 6, 2026
@tim-smart
tim-smart enabled auto-merge (squash) August 6, 2026 10:08
@tim-smart
tim-smart disabled auto-merge August 6, 2026 10:08

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

This PR fixes real cross-copy recognition bugs, but it is missing the changeset required for the public effect package runtime changes.

Reviewed changes

This PR replaces constructor-identity instanceof checks with _tag-based guards for tagged errors so that duplicate package copies / module reloads recognize the same error type. Reviewed 10 files:

  • packages/effect/src/Config.ts — tag guard for ConfigProvider.SourceError
  • packages/effect/src/unstable/rpc/RpcClient.ts — tag guard for RpcClientError
  • packages/effect/test/Config.test.ts and packages/effect/test/rpc/RpcClient.test.ts — cross-copy regression tests
  • packages/tools/api-diff/src/{Annotations,ApiDiff,Error,Snapshot,Worktrees}.ts — tag guards and adoption for ApiDiffError and SnapshotExtractionError
  • packages/tools/api-diff/test/Error.test.ts — cross-copy guard tests

All tests, type checks, and lint pass.

⚠️ Missing changeset for effect package

The effect package has public runtime behavior changes (cross-copy SourceError and RpcClientError recognition). Per repo convention, this needs a .changeset/*.md entry. The @effect/api-diff package is private, so its new guards do not require one.

Technical details
# Missing changeset

## Affected sites
- `packages/effect/src/Config.ts:197-205``isSourceError` guard changes recoverable source-failure path
- `packages/effect/src/unstable/rpc/RpcClient.ts:55,966``isRpcClientError` guard changes error-preservation path

## Required outcome
- Add a `.changeset/*.md` entry bumping `effect` with a patch describing the cross-copy tagged-error recognition fix.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

The only new commit since the prior review adds the missing changeset requested in the previous review.

  • Added changeset for effect patch.changeset/bright-tags-recognize.md bumps effect with a patch note describing the cross-copy tagged-error recognition fix for ConfigProvider.SourceError and RpcClientError.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
basic.ts 6.92 KB 6.92 KB 0.00 KB (0.00%)
batching.ts 9.72 KB 9.72 KB 0.00 KB (0.00%)
brand.ts 6.40 KB 6.40 KB 0.00 KB (0.00%)
cache.ts 10.59 KB 10.59 KB 0.00 KB (0.00%)
config.ts 20.62 KB 20.61 KB +0.01 KB (+0.03%)
differ.ts 20.21 KB 20.21 KB 0.00 KB (0.00%)
http-client.ts 21.50 KB 21.50 KB 0.00 KB (0.00%)
logger.ts 10.81 KB 10.81 KB 0.00 KB (0.00%)
metric.ts 8.86 KB 8.86 KB 0.00 KB (0.00%)
optic.ts 7.25 KB 7.25 KB 0.00 KB (0.00%)
pubsub.ts 14.86 KB 14.86 KB 0.00 KB (0.00%)
queue.ts 11.54 KB 11.54 KB 0.00 KB (0.00%)
schedule.ts 10.71 KB 10.71 KB 0.00 KB (0.00%)
schema-class.ts 19.14 KB 19.14 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 28.98 KB 28.98 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 25.28 KB 25.28 KB 0.00 KB (0.00%)
schema-string-transformation.ts 13.31 KB 13.31 KB 0.00 KB (0.00%)
schema-string.ts 10.85 KB 10.85 KB 0.00 KB (0.00%)
schema-template-literal.ts 15.08 KB 15.08 KB 0.00 KB (0.00%)
schema-toArbitraryLazy.ts 21.93 KB 21.93 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 24.33 KB 24.33 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 19.17 KB 19.17 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 18.98 KB 18.98 KB 0.00 KB (0.00%)
schema-toFormatter.ts 18.86 KB 18.86 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 22.58 KB 22.58 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 19.48 KB 19.48 KB 0.00 KB (0.00%)
schema.ts 18.40 KB 18.40 KB 0.00 KB (0.00%)
stm.ts 12.59 KB 12.59 KB 0.00 KB (0.00%)
stream.ts 9.67 KB 9.67 KB 0.00 KB (0.00%)

@tim-smart
tim-smart merged commit 0418564 into main Aug 6, 2026
20 checks passed
@tim-smart
tim-smart deleted the agent/codex-engineer/d854a64d branch August 6, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant