Repository navigation
fix(worker): keep shared environment deletes out of property caches - #52
Merged
Merged
Conversation
Preserve the in-place SHARE_ENV identity fix while ensuring optimized delete sites still remove entries from the shared environment store. Cover direct and Reflect deletion with an independent observing worker. Adapts the property-cache guard from oven-sh#38871; thanks @robobun.
steipete
added a commit
to steipete/bun
that referenced
this pull request
Oct 12, 2026
Keep JIT-warmed direct and Reflect deletes connected to the SHARE_ENV backing store while preserving cached process.env and Bun.env references. Port the regression coverage from openclaw#52; the property-cache guard also appears in oven-sh#38871 by robobun. Merge current upstream main to resolve the existing branch conflict, retaining inherited-receiver writes. Both new modes fail at the prior PR head and pass Node 24.21.0 and the candidate. The Windows proxy inspector also follows the shared store after promotion, with coverage for subsequent writes and deletes. Linux worker, environment, and process coverage passes 352 tests with 6 existing skips.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hot
delete process.env[key]andReflect.deleteProperty(process.env, key)calls could returntrueafterSHARE_ENVpromotion while leaving the variable visible to other workers. This regressed in #42: promotion retainedJSEnvironmentVariableMap, whose structure lacked the property-cache prohibition already used byJSSharedEnvMap.Add that guard to the retained environment class, preserving cached
process.env/Bun.envidentity and routing optimized deletes through the shared store. The guard adapts the same change in the open upstream PR oven-sh#38871; thanks @robobun. New direct/Reflect tests warm absent-key deletion and verify the result from an independent worker, the cached parent reference, own-property lookup, and enumeration. No OpenClaw test expectations or service/migration guards change.Native Linux x64 proof: the three standalone owner-key repros pass Node 24.21.0, fail a fresh
6ea7ca5a2cbuild, pass with only #42 reverted, and pass with this patch on fork main. Both new regression modes pass Node 24 and fail unpatched Bun on macOS arm64 and Linux x64. The patched modes pass on Linux. Surrounding worker, transfer-list, process, Windows-environment proxy, and CLI environment suites pass 387 tests with 6 platform skips. The first process-suite invocation lacked test dependencies; installing the repository's test dependencies resolved its import error. Formatting, JS lint, and independent Codex review at P2 pass.Each OpenClaw file ran alone against the same frozen source, with Node 24 orchestration, one Bun worker, and private HOME/state/temp directories:
src/gateway/test-helpers.server-env.test.tssrc/infra/state-migrations.caller-mode.storage.test.tssrc/cli/update-cli/update-command-post-update.test.tsThe exact CI merge binary for sync PR #51 at head
66f26177e8still fails all three standalone repros. Its affected environment sources are unchanged. The newer #51 head65512c7aa3only adjusts literal-hash module keys; its environment implementation and WebKit pin are unchanged relative to the tested head. This PR does not modify #51 and is not merged.The native build-and-test lane is green on head
37719a2637: all 22 selected files passed, including the new worker regressions. Format, JS lint and source lints are green. The separate Claude automation check fails before review because its required authentication is absent.