Repository navigation
fix(inspector): release retained snapshot metadata on session cleanup - #141
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
October 8, 2026 02:59
This was referenced Oct 8, 2026
steipete
added a commit
to openclaw/openclaw
that referenced
this pull request
Oct 8, 2026
Advance the shared Bun pin from fc53 to 42bd for deferred VM bytecode generation, integral heap-sampling sizes, and inspector snapshot cleanup (openclaw/bun#137, openclaw/bun#140, openclaw/bun#141). Keep WebKit cb8d6f202b and update the four verified Darwin/Linux artifact pins and CI documentation. Gate A passed: 35 paired selections, 270 targeted cells, no candidate regressions, ten Node-hidden smoke steps with zero Node attempts, and supplemental JSC checks. Both Darwin architecture gates passed. Preserve the baseline-only UI palette intermittent in #167000; #166780 is not claimed fixed. No new admissions qualified. Pin staging tests, changed checks, independent P2 review, exact-head CI, and ClawSweeper passed without a CI rerun.
steipete
added a commit
to openclaw/openclaw
that referenced
this pull request
Oct 8, 2026
Use the native profiling owner on Node and Bun while preserving admission, redaction, bounds, and cleanup. Exercise CPU, heap, and snapshot captures on the selected runtime, retain a genuine Node oracle for V8 tracking, and reject Bun environment-started debugger conflicts. The consumer cutover depends on the shared Bun pin including openclaw/bun#140 and openclaw/bun#141. Node 24 and the combined fixed Bun pass all 112 targeted cases; the previous pin still fails the integral heap-profile contract.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 9, 2026
Advance the shared Bun pin from fc53 to 42bd for deferred VM bytecode generation, integral heap-sampling sizes, and inspector snapshot cleanup (openclaw/bun#137, openclaw/bun#140, openclaw/bun#141). Keep WebKit cb8d6f202b and update the four verified Darwin/Linux artifact pins and CI documentation. Gate A passed: 35 paired selections, 270 targeted cells, no candidate regressions, ten Node-hidden smoke steps with zero Node attempts, and supplemental JSC checks. Both Darwin architecture gates passed. Preserve the baseline-only UI palette intermittent in openclaw#167000; openclaw#166780 is not claimed fixed. No new admissions qualified. Pin staging tests, changed checks, independent P2 review, exact-head CI, and ClawSweeper passed without a CI rerun.
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.
v8.writeHeapSnapshot()leaves a native snapshot in JavaScriptCore's HeapProfiler. Source inspection shows that in-processHeapProfiler.disableand Session disconnection currently leave this metadata behind, so later collections continue pruning the retained snapshot map.This change clears the current VM's snapshot metadata through the existing native profiler owner when a local Session disables HeapProfiler or disconnects. It preserves allocation-sampling cleanup and avoids clearing a worker's own VM for an unsupported main-thread connection.
The regression keeps an independent JSC inspector observer connected, writes a real snapshot, and verifies that the observer can resolve a retained marker before cleanup. After cleanup the same lookup must report that no snapshot exists. It covers disable and disconnect with and without prior enable, plus callback completion. No new public API or test-only hook is introduced.
Validation
755b2da222558ba779687722f2615cf4ad49bc48: native CI passes on Linux x64 and macOS arm64. Linux passes 17/17 result rows; macOS passes 13/13. Both pass all 60 inspector-profiler tests and all 24 inspector API tests. CI built synthetic merge7e9999a849bb29683418502725336e96a9641078.667c4ab22candfc53bf8c0feach fail all five cleanup cases at the intended final assertion, because the native observer still resolves snapshot metadata after disable/disconnect. Every marker-preview positive control passes. Each invocation filters 55 unrelated cases by test name; no runtime skip is used.v8-heap-snapshot.test.tssuite passes 7/7 with zero skips. Its first attempt had two setup failures because the declaredv8-heapsnapshot@1.3.1test dependency was absent; installing the declared test workspace dependencies fixed setup without changing source, and the complete snapshot suite then passed.6ed43f8a0497032f26cc38e894dc6f77b23b8ca69e2d9e6acc5ec631e3ad8bd4.git diff --checkpass.The initial CI run failed all five new cases because the expected JSC error omitted its
datafield. It had already resolved the marker before cleanup and receivedNo heap snapshotafterward. A test-only correction now asserts the complete error envelope; the failed run was not rerun or counted as passing.OpenClaw consumer proof and the shared runtime pin update continue separately. No measured retention improvement or runtime publication is claimed.
Related upstream work
oven-sh/bun#34719 adds broader in-process inspector support but retains stubbed HeapProfiler cleanup. oven-sh/bun#34085 preserves IDs between successive snapshots; it does not implement explicit cleanup. Both remain open. This patch addresses the existing cleanup commands without porting general Runtime evaluation or heap-object-ID APIs.