Skip to content

fix(fs): register watch callbacks as change listeners - #180

Merged
steipete merged 2 commits into
openclaw:mainfrom
steipete:claude/fs-watch-change-listener
Oct 16, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
steipete:claude/fs-watch-change-listener

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown

What does this PR do?

Registers the listener passed to fs.watch() as a change listener on the returned FSWatcher. Listener inspection, manual emit(), removal, and registration order now include that callback. The separate callback field and its duplicate dispatch sites are removed. A rejected listener releases the native watch rather than leaving an open handle.

Ports the existing open proposal oven-sh/bun#43765, by robobun. No competing upstream proposal is needed.

How did you verify your code works?

  • Node.js 24.22.0 passes the portable listener oracle; unpatched Bun fails at listenerCount("change").
  • On a native Linux release build, the new listener group changes from 5 passes / 15 failures to 20 passes. Coverage includes overloads, callback receiver, synthetic and native events, ordering, removal, invalid listeners, and native-handle cleanup.
  • The surrounding test/js/node/watch and test/js/node/fs run records 1,030 passes and 122 skips. Its four load errors came from omitting the internal-testing flag; rerunning only those four files with the standard BUN_FEATURE_FLAG_INTERNAL_FOR_TESTING=1 --expose-internals setup gives 18 passes, 5 platform skips, and no failures on both baseline and patched builds.
  • The affected OpenClaw consumer file changes from 7 passes / 3 failures to 10 passes with the patched runtime and isolated temporary state.
  • JavaScript lint, formatting, and independent P2 reviews pass, including the refresh onto current main. The refreshed head passes Linux and macOS CI.

@steipete
steipete marked this pull request as ready for review October 16, 2026 11:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T11:33:01.163806Z 4061abf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 5be0e8e into openclaw:main Oct 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant