Skip to content

Conversation

@arlyon
Copy link

@arlyon arlyon commented Dec 4, 2025

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

In some places (frozen-intrinsics, deterministic sandboxes like in temporal), error is readonly to limit the amount of peturbation. This causes issues when effect assumes it can modify, leading to exceptions. This changes that code to a best-effort attempt with a silent failure. I chose to just duplicate the snippet in the ai lib.

Related

Though outside this repo, this pattern is used within node itself. The core snippet comes from their internal checks. I have added a wrapper to DRY the set, unset, and error handling.

https://github.com/nodejs/node/blob/e77694631f1642c302f664703197b5aabc65b482/lib/internal/errors.js#L246

@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2025

⚠️ No Changeset found

Latest commit: 1757334

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@mikearnaldi
Copy link
Member

withStackTraceLimit will introduce a stack frame so it changes the shape of the trace

@arlyon
Copy link
Author

arlyon commented Dec 8, 2025

Ah, you are correct. I will re-impl without the helper just with the check

@arlyon arlyon force-pushed the arlyon/work-with-frozen-intrinsics branch from c3df8ed to 1757334 Compare December 8, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

2 participants