Commit b8b52ce
authored
refactor: async_hooks patch to opt-in entrypoint, remove from default load path (#3085)
## Plan: Fix lint failure
- [x] Identified lint failure as Prettier formatting issue
- [x] Ran Prettier --write on test file
- [x] Verified tests still pass
- [x] Verified lint passes
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Remove async_hooks patch</issue_title>
> <issue_description>`@endo/init` started patching `node:async_hooks` in
#1115 to address debugger issues (see #1105).
>
> While Node.js's async_hooks implementation remains incompatible with
frozen promises, I hear Node.js's inspector support has since stopped
relying on async_hooks, so we should be able to remove the patch
entirely. This may be needed as there are signs our async_hooks monkey
patch is partially broken under Node.js 24.</issue_description>
>
> <agent_instructions>Remove the patch and its remnants which break in
Node 24. Include a changesets entry that references issue #1105 that led
us to include it to for local debugging of node processes in lockdown
mode. We don't know whether it's still necessary in Node 20+ so we've
removed it. If it still is, we'll restore the functionality in a new way
that is compatible with Node 24</agent_instructions>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> <comment_new><author>@kriskowal</author><body>
> What’s the oldest Node.js version that the patch is necessary? Do we
have the option of applying the patch contingent on
`process.version`?</body></comment_new>
> <comment_new><author>@turadg</author><body>
> > This may be needed as there are signs our async_hooks monkey patch
is partially broken under Node.js 24.
>
> Confirmed in
https://github.com/endojs/endo/actions/runs/21961549067/job/63440058166?pr=3083
>
> ```
> TypeError: this._enable is not a function
> at AsyncLocalStorage.run
(packages/init/src/node-async-local-storage-patch.js:72:8)
> at packages/init/test/async_hooks.test.js:88:14
> ```
>
> Can we go ahead and remove the patch?</body></comment_new>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes #3012
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/endojs/endo/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.1 parent 81b4c40 commit b8b52ce
File tree
7 files changed
+49
-19
lines changed- .changeset
- packages/init
- src
- test
7 files changed
+49
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | | - | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
| |||
75 | 85 | | |
76 | 86 | | |
77 | 87 | | |
78 | | - | |
| 88 | + | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
85 | 102 | | |
86 | 103 | | |
87 | 104 | | |
| |||
0 commit comments