Skip to content

fix(runtime): close Bun watcher and harness gaps - #150655

Merged
steipete merged 8 commits into
mainfrom
codex/bun-runtime-final-compat
Sep 17, 2026
Merged

steipete merged 8 commits into
mainfrom
codex/bun-runtime-final-compat

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Direct Bun runs exposed Node-shaped assumptions outside the plugin loader: native skill watcher registration could miss readiness/change assertions, shell proof helpers relied on Node's stdin-module entrypoint and eval argv layout, a cancellation fixture depended on native watcher delivery, and subprocess tests treated the current Bun executable as Node.

This makes Bun use Chokidar polling by default while preserving explicit CHOKIDAR_USEPOLLING overrides, runs shell heredoc modules from owned temporary .mjs files, gives each ClawHub proof an isolated temporary directory with exit cleanup, and polls explicit fixture files instead of coupling cancellation and process-drain coverage to fs.watch. The affected tests use real filesystem ancestry and resolve an actual Node executable for Node-specific rows.

Two process-lifetime leaks needed ownership fixes. The Bun-only N-API realpath fallback in @openclaw/fs-safe lazily creates a process-lived callback on first missing-path resolution, so boundary resolution now enters a stable async context until oven-sh/bun#42374 lets that fallback be removed. Bun also retains the first Bun.plugin setup closure process-wide, so the one-time resolver and loader hooks now install from module-level functions that cannot capture a retiring plugin generation.

The branch also keeps Slack acknowledgement bytes stable across the Buffer and ArrayBuffer WebSocket shapes accepted by ws.

After current main added a system-level systemd availability probe, the Doctor transport fixture now models the complete fallback: the expected machine-scoped busctl failure is followed by systemctl --system is-system-running, while the original user-bus-unavailable outcome remains enforced.

A second current-main composition repair keeps the labeler workflow's exact changed-test routing assertion aligned with its existing ancillary concurrency owner.

The current boundary-shard planner also keeps its canonical shard clone immutable while using the repository's lint-clean Object.assign form.

Validation:

  • pnpm build
  • node scripts/check-changed.mjs
  • Independent P0-P2 review: clean
  • Direct Bun and Node 24 after the final rebase: plugin runtime retention 9/9, state lease retention 3/3, boundary paths 9/9, native module require 13/13
  • Linux-path Doctor transport emulation under direct Bun and Node 24: 4/4 each
  • Labeler changed-target routing under direct Bun and Node 24: focused case passes under each runtime
  • Changed Node CI planner: 217/217 under direct Bun and 217/217 under Node 24; complete scripts changed-file gate
  • Direct Bun: 7/7 missing-root watcher tests; 57/57 watcher unit tests; 7/7 Agent Plugin cancellation tests; 44/44 shell tempfile tests; 111/111 Parallels model tests; focused Doctor and Kitchen Sink rows
  • Node 24: 57/57 watcher unit tests; 7/7 Agent Plugin cancellation tests; 44/44 shell tempfile tests; focused Doctor and Kitchen Sink rows; Slack provider interop 19/19
  • Node 24 and Node 26: process-drain deadline fixture passes on both supported lines
  • Concurrent direct-Bun and Node shell suites: 44/44 each, proving per-run tempfile isolation
  • Custom Bun with undici: export ping() and publish undici:websocket:ping/pong diagnostics channels oven-sh/bun#37111 applied: Slack provider interop 19/19; shipping Bun 1.4.2 lacks the required undici.ping export and ping/pong diagnostics channels
  • bash -n scripts/e2e/lib/skills/clawhub-install-proof.sh

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 17, 2026, 5:22 AM ET / 09:22 UTC (Revision 8).

ClawSweeper review

What this changes

The PR repairs Bun skill watching and callback retention, and makes shell proof helpers and runtime tests behave consistently across Bun and Node.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains useful work absent from the pinned main branch. No actionable introduced defect was found, and the previous generic migration blocker is unsupported by the actual diff.

Priority: P2
Reviewed head: 7a45c79ccc6e06e5ef851b9e253cbf8b4f13ff1c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused compatibility repair with substantial reported validation and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer context exempts this PR from the external-contributor proof gate; reported Bun/Node watcher, callback-retention, and harness runs support the changed paths, and no material authority change activates additional proof requirements.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied maintainer context exempts this PR from the external-contributor proof gate; reported Bun/Node watcher, callback-retention, and harness runs support the changed paths, and no material authority change activates additional proof requirements.
Evidence reviewed 10 items Verified merge scope: The test merge records the pinned main and PR head as its ordered parents. Its delta contains only the introduced runtime, harness, and test changes; the database and session changes in endpoint drift belong to main.
Existing polling implementation and overrides: The Bun default selects the existing polling implementation only when CHOKIDAR_USEPOLLING is unset. Explicit values and skills.load.watch remain respected; skill-file filtering, invalidation, and watcher cleanup remain owned by the same module.
Callback ownership: Module-level installation functions remove the retiring binding from the hook-installation closure. Resolver iteration, native fallback, owner registration, and disposal remain unchanged; plugin-native-module-loader still registers cleanup with the instance lifecycle.
Findings None None.
Security None None.

How this fits together

Skill watchers invalidate cached skill descriptions when files change, while plugin loaders resolve code for active plugin generations. The runtime adapters and validation scripts support those flows under Bun and Node.

flowchart TD
  A[Skill files] --> B[Runtime and polling preference]
  B --> C[Shared skill watchers]
  C --> D[Skill cache invalidation]
  E[Plugin imports and filesystem paths] --> F[Runtime adapters]
  F --> G[Resolved paths and plugin modules]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +18, Tests +8, Other +22. Total +48 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 3 58 40 +18
Tests 10 53 45 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 35 13 +22
Total 15 146 98 +48

Review metrics

Metric Value Why it matters
Runtime default 1 Bun-only default change; 0 new configuration options Polling becomes the Bun default while the existing explicit override and watch-disable setting retain precedence.

Stored data model

Persistent data-model change detected: serialized state: src/plugins/native-module-require.ts, unknown-data-model-change: src/plugins/native-module-require.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep runtime compatibility repairs within the existing watcher and loader owners, preserving explicit polling preferences and filesystem identity semantics.

Do we have a high-confidence way to reproduce the issue?

No independently executed reproduction was established in this read-only review; source identifies the affected paths, and the captured body reports focused Bun failures and successful after-fix validation.

Is this the best way to solve the issue?

Yes. The patch reuses existing polling and resolution contracts, isolates temporary artifacts, and removes generation capture without adding competing runtime owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9ab47386778b.

Labels

Label justifications:

  • P2: These bounded runtime compatibility and validation repairs improve the opt-in Bun workflow without an established emergency regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer context exempts this PR from the external-contributor proof gate; reported Bun/Node watcher, callback-retention, and harness runs support the changed paths, and no material authority change activates additional proof requirements.

Evidence

What I checked:

  • Verified merge scope: The test merge records the pinned main and PR head as its ordered parents. Its delta contains only the introduced runtime, harness, and test changes; the database and session changes in endpoint drift belong to main. (a362604c5f26)
  • Existing polling implementation and overrides: The Bun default selects the existing polling implementation only when CHOKIDAR_USEPOLLING is unset. Explicit values and skills.load.watch remain respected; skill-file filtering, invalidation, and watcher cleanup remain owned by the same module. (src/skills/runtime/refresh.ts:422, 7a45c79ccc6e)
  • Callback ownership: Module-level installation functions remove the retiring binding from the hook-installation closure. Resolver iteration, native fallback, owner registration, and disposal remain unchanged; plugin-native-module-loader still registers cleanup with the instance lifecycle. (src/plugins/native-module-require.ts:177, 7a45c79ccc6e)
  • Dependency inspection applies to filesystem resolution: The introduced wrapper directly calls @openclaw/fs-safe/advanced inside a stable async context, establishing the dependency signal. It preserves the argument and return contract and does not introduce a schema, migration, or authorization decision. (src/infra/boundary-path.ts:15, 7a45c79ccc6e)
  • Pinned dependency contract: GitHub verified repository ownership and resolved v0.13.1 to this commit. The synchronous existing-ancestor resolver uses filesystem checks and realpath; native configuration uses module-level overrides and environment variables, not request-local authorization. The realpath implementation explicitly documents its Bun N-API workaround. (src/root-path-existing.ts:143, 7022a0a10c53)
  • Current main and release necessity: Pinned main still defaults polling only on os400, and the latest release v2026.9.4 has the same default. Main also lacks the new boundary-context wrapper. No merged replacement is established by the supplied related context. (src/skills/runtime/refresh.ts:422, 9ab47386778b)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-09-17T06:07:37.751Z sha 4009763 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T06:35:08.880Z sha aa2c5e7354cb60a899ac04af76c10bc1374ff500 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T07:05:58.664Z sha debd36e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T07:59:14.144Z sha 1284b2c7fcaa2be6db1f1a185633fd35ad66bfbb :: blocked before merge. :: none
  • reviewed 2026-09-17T08:15:24.147Z sha 9b185de44b67ce821aa53859e70ac9dfb8fdba9b :: blocked before merge. :: none
  • reviewed 2026-09-17T08:47:29.030Z sha 59bf297a4099b83b8caa2c50a4c07b63f8d25848 :: blocked before merge. :: none
  • reviewed 2026-09-17T09:03:12.907Z sha c41160cd065a0c13977997bfd08d534475123f7a :: blocked before merge. :: none

@steipete
steipete force-pushed the codex/bun-runtime-final-compat branch from 4009763 to aa2c5e7 Compare September 17, 2026 06:26
@openclaw-barnacle openclaw-barnacle Bot added the channel: slack Channel integration: slack label Sep 17, 2026
@steipete
steipete force-pushed the codex/bun-runtime-final-compat branch 2 times, most recently from debd36e to 1284b2c Compare September 17, 2026 07:52
@steipete
steipete force-pushed the codex/bun-runtime-final-compat branch 2 times, most recently from 59bf297 to c41160c Compare September 17, 2026 08:55
@steipete
steipete force-pushed the codex/bun-runtime-final-compat branch from c41160c to 7a45c79 Compare September 17, 2026 09:14
@steipete
steipete merged commit 5764fa4 into main Sep 17, 2026
215 checks passed
@steipete
steipete deleted the codex/bun-runtime-final-compat branch September 17, 2026 09:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 17, 2026
…118830)

Preserve signed generated-media references when completion and retry prompts pass through legacy reply parsing. Delimit vulnerable punctuation and literal quotes in the shared formatter, and keep explicitly delimited values intact in parse-output.ts through validation and fallback handling.

Retain ordinary unquoted cleanup, file-URL conversion ownership, attachment validation, current prompt modes, and missing-only recovery. Add producer-to-parser regressions and document quoted legacy references.

P0-P2 review is clean. The refresh onto 62507cc preserves the complete reviewed patch and all five file hashes. Retained Blacksmith Testbox run 35193105282 at the previous verified head proves 17 intended original-code failures, 557 passing candidate tests, and the complete selected changed gate. Fresh exact-head CI run 35215130600 passes with 140 successful jobs and a green rollup, including 39 current media-path tests and 18 current local-root tests. Those results satisfy ClawSweeper's refreshed-coverage requests; no introduced code or security defect was found. The previous unrelated Doctor fixture CI failure is fixed in the refreshed main by #150655. Final refreshed fingerprints and diff checks pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
* fix(runtime): close Bun watcher and harness gaps

* test(slack): normalize ArrayBuffer acknowledgement bytes

* test(parallels): stabilize cross-runtime drain fixture

* fix(runtime): detach process-stable Bun callbacks

* fix(runtime): avoid Bun TODO lint suppression

* test(doctor): cover systemd fallback probe

* test(ci): include labeler concurrency owner

* fix(ci): keep changed-plan clone lint-clean
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…penclaw#118830)

Preserve signed generated-media references when completion and retry prompts pass through legacy reply parsing. Delimit vulnerable punctuation and literal quotes in the shared formatter, and keep explicitly delimited values intact in parse-output.ts through validation and fallback handling.

Retain ordinary unquoted cleanup, file-URL conversion ownership, attachment validation, current prompt modes, and missing-only recovery. Add producer-to-parser regressions and document quoted legacy references.

P0-P2 review is clean. The refresh onto df1202d preserves the complete reviewed patch and all five file hashes. Retained Blacksmith Testbox run 35193105282 at the previous verified head proves 17 intended original-code failures, 557 passing candidate tests, and the complete selected changed gate. Fresh exact-head CI run 35215130600 passes with 140 successful jobs and a green rollup, including 39 current media-path tests and 18 current local-root tests. Those results satisfy ClawSweeper's refreshed-coverage requests; no introduced code or security defect was found. The previous unrelated Doctor fixture CI failure is fixed in the refreshed main by openclaw#150655. Final refreshed fingerprints and diff checks pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant