Skip to content

fix(runtime): preserve Node worker dependencies and cleanup diagnostics - #155292

Merged
steipete merged 7 commits into
mainfrom
codex/bun-compatibility-runtime-fixes-73f
Sep 22, 2026
Merged

steipete merged 7 commits into
mainfrom
codex/bun-compatibility-runtime-fixes-73f

Conversation

@steipete

@steipete steipete commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bun-driven Mac worker packaging treated Bun's built-in ws and undici as Node built-ins and could remove packages the installed Node worker needs. Spawn diagnostics also labeled Bun as an unknown command, a watcher fixture inspected state before its queued event ran, and catalog refresh warnings lost nested cleanup errors.

User Impact

Mac Node workers retain their dependencies when packaging runs under Bun. Spawn diagnostics identify Bun, and catalog warnings preserve nested causes with the existing credential redaction. Node installation behavior and dependencies are unchanged; there is no alternate SQLite dependency or new configuration.

Why This Change Was Made

The packager obtains built-in module facts from the installed Node executable already used for pruning and applies them to both dependency traversals. Its tests cover external ws, transitive undici, and actual Node built-ins. Watcher fixtures await the queued raw event, while catalog refresh uses the existing aggregate-aware error formatter and retains the superseded-publication filter.

Evidence

The candidate 911123fe includes main 7ef42cc8. It preserves main's extraction of spawn diagnostics into spawn-diagnostics.ts and applies Bun classification at that owner; the retained tests use the canonical imports. Independent P0–P2 review found no actionable issue in that adaptation. The eight-file compatibility patch is unchanged after incorporating main's wrapper-inventory repair. Canonical main also owns the embeddings fixture cleanup and real request-admission proof (#155703), and moves history-benchmark preparation outside the child deadline (#155780). The overlapping changes from this PR were removed.

The preceding candidate bda36261 passed CI and native hosted preparation. Its merge attempt stopped before dispatch because main had extracted the diagnostics owner. The adaptation passed focused independent review, formatting, and whitespace checks. The subsequent 8dd5b44a CI run exposed missing SQLite-context and spawn-diagnostics modules in the extracted PR tooling inventory. This candidate incorporates canonical main's inventory repair; existing failing assertions are unchanged.

CI for 911123fe initially had one substantive failure: state-lifecycle coordinator contention during setup of a queued-compaction test, before its body ran. The other 1,235 tests in that job passed. The affected test and lifecycle owners are unchanged by this PR. The exact tested merge was then replayed on native Testbox with Node 24.19.0, CI mode, and two workers: the original file passed all 23 tests, and the original 62-file group passed 1,236 tests with four existing skips. The contention did not reproduce, so no root-cause fix is claimed. One evidence-qualified failed-job retry passed on CI attempt 2, including the previously failing shard. No assertion, timeout, or storage contract changed.

Historical isolated Node/custom-Bun proof for the original runtime repairs passed 39 cases with three existing skips and no unhandled errors; actual test-worker executables were verified. Pinned 452f4f19 also passed the custom-Bun build, readiness, and full check including test types, lint, formatting, and policy checks. Six paired SQLite cells passed 16 selected cases with coordinator and fork-worker executable verification. These results retain their tested-source attribution and do not establish full acceptance of this rebased head.

A later native preparation accidentally ran the full suite locally. That incomplete run was stopped, its logs preserved, and the tooling route corrected to hosted preparation. Its nested-checkout dependency-resolution error, watcher/ONNX/tooling failures, and MCP keepalive failure remain unclassified; they are not direct-Bun acceptance results.

Repository-wide custom-Bun acceptance remains incomplete. The landed-main matrix, package/update, Gateway/UI E2E, and stress proof remain part of the continuing compatibility campaign. No stock-Bun compatibility or release claim is made.

@clawsweeper

clawsweeper Bot commented Sep 22, 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 22, 2026
@steipete
steipete marked this pull request as ready for review September 22, 2026 00:39
@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 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 22, 2026, 7:12 PM ET / 23:12 UTC (Revision 17).

ClawSweeper review

What this changes

The PR preserves Node worker dependencies when packaging runs under Bun, improves runtime diagnostics, and synchronizes watcher tests with queued events.

Merge readiness

⛔ Needs changes before merge - 1 item remains

The fixes remain useful on current main. The pinned patch has no actionable correctness findings, and the previously reported archive-restoration concern is absent from its current scope.

Priority: P2
Reviewed head: 911123feb749e4a004ab5e84489ef5c497e0c2c2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with meaningful regression coverage and no blocking code findings; test-cost documentation remains incomplete.
Proof confidence 🌊 off-meta tidepool Not applicable: The provided MEMBER author classification exempts this PR from the external-contributor proof gate. Historical checks cover dependency planning and diagnostics but retain their earlier-source attribution; they do not establish full Bun compatibility. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The provided MEMBER author classification exempts this PR from the external-contributor proof gate. Historical checks cover dependency planning and diagnostics but retain their earlier-source attribution; they do not establish full Bun compatibility. No stored-data contract changes.
Evidence reviewed 8 items Pinned patch ownership: Inspected the complete introduced delta from the pinned base to the exact head. Database-retention and history-benchmark changes are absent. The supplied test merge is stale and was not used to infer merge-result behavior.
Target runtime owns dependency classification: The planner reads built-ins from the installed Node executable and uses that set in both root and internal-package traversal. All planner callers supply the executable. The staging script already verifies and executes this installed runtime before pruning.
Current-main necessity: The three production files are unchanged between the pinned base and fetched main: packaging still uses the executing runtime’s isBuiltin, spawn diagnostics omit Bun, and catalog warnings use String(error). These repairs have not been superseded on the reviewed main revision.
Findings None None.
Security None None.

How this fits together

Mac worker packaging selects the files and dependencies shipped with the app’s private Node runtime. Separate runtime diagnostics turn process launches and catalog-refresh failures into operator-visible logs.

flowchart TD
  A[Installed package] --> B[Worker dependency planner]
  C[Installed Node built-ins] --> B
  B --> D[Packaged Mac worker]
  E[Process launches and catalog failures] --> F[Diagnostic classification and formatting]
  F --> G[Redacted operator logs]
Loading

Before merge

  • Complete next step (P2) - Add the previously requested changed-test wall times and available CI durations to the PR evidence, reusing existing measurements with their tested-source attribution.
Agent review details

Security

None.

PR surface

Source +1, Tests +55, Other +29. Total +85 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 2 3 2 +1
Tests 5 67 12 +55
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 38 9 +29
Total 8 108 23 +85

Review metrics

None.

Technical review

Best possible solution:

Keep dependency facts owned by the packaged Node runtime and reuse the existing diagnostic formatter without broadening this into repository-wide Bun acceptance.

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

Yes, from source: current main classifies packaged dependencies using the host runtime and discards nested AggregateError details through String(error). No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes. Consulting the already-required target Node executable and using the existing redacting error formatter repair the responsible owners without introducing competing implementations.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded packaging and diagnostic repair, with no demonstrated urgent user-facing outage.
  • 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 provided MEMBER author classification exempts this PR from the external-contributor proof gate. Historical checks cover dependency planning and diagnostics but retain their earlier-source attribution; they do not establish full Bun compatibility. No stored-data contract changes.

Evidence

What I checked:

  • Pinned patch ownership: Inspected the complete introduced delta from the pinned base to the exact head. Database-retention and history-benchmark changes are absent. The supplied test merge is stale and was not used to infer merge-result behavior. (911123feb749)
  • Target runtime owns dependency classification: The planner reads built-ins from the installed Node executable and uses that set in both root and internal-package traversal. All planner callers supply the executable. The staging script already verifies and executes this installed runtime before pruning. (scripts/prune-mac-node-worker.ts:118, 911123feb749)
  • Current-main necessity: The three production files are unchanged between the pinned base and fetched main: packaging still uses the executing runtime’s isBuiltin, spawn diagnostics omit Bun, and catalog warnings use String(error). These repairs have not been superseded on the reviewed main revision. (scripts/prune-mac-node-worker.ts:143, eeb450c9cf2d)
  • Shared formatter preserves redaction: The changed warning uses the existing core adapter, which passes redactSensitiveText to the aggregate-aware normalization formatter. The superseded-publication filter remains intact. No provider routing, authorization, or Codex-specific contract changes. (src/infra/errors.ts:23, 911123feb749)
  • Review continuity and outstanding evidence: The captured body at sourceRevision dd6d4fd18a93dae0d5a57bce38760f50cc7f3b2fc2230ad5b4f754f4b65efb58 and the live body both describe historical Node/custom-Bun checks, source-attributed CI, and the non-reproducing contention investigation. Neither states the changed-test wall times requested by the preceding review. Root policy independently requires these measurements and available CI seconds. (AGENTS.md:88, 911123feb749)
  • Related repairs already separated: The supplied GitHub records verify that test(gateway): isolate embedding cleanup fixture state #155703 merged the embeddings-fixture repair and fix: keep history benchmark startup outside test deadlines #155780 merged the benchmark-startup repair. Their former overlap was removed from this branch; neither replaces its remaining runtime fixes.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record changed-test wall times and available CI durations in the PR body, preserving the tested revision when reusing existing measurements.

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 (16 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-22T10:56:44.288Z sha 452f4f1 :: needs changes before merge. :: none
  • reviewed 2026-09-22T12:22:24.856Z sha ff4679a :: needs changes before merge. :: none
  • reviewed 2026-09-22T17:52:56.291Z sha ff4679a :: needs changes before merge. :: none
  • reviewed 2026-09-22T18:46:25.137Z sha bda3626 :: needs changes before merge. :: none
  • reviewed 2026-09-22T19:57:59.345Z sha bda3626 :: blocked before merge. :: none
  • reviewed 2026-09-22T20:11:28.424Z sha 8dd5b44 :: needs changes before merge. :: none
  • reviewed 2026-09-22T21:14:46.370Z sha 911123f :: needs changes before merge. :: none
  • reviewed 2026-09-22T22:28:58.116Z sha 911123f :: needs changes before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 22, 2026
@steipete
steipete force-pushed the codex/bun-compatibility-runtime-fixes-73f branch from b83bf95 to 4bc317b Compare September 22, 2026 04:40
@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Sep 22, 2026
@steipete
steipete force-pushed the codex/bun-compatibility-runtime-fixes-73f branch from 4bc317b to 4371594 Compare September 22, 2026 06:30
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 22, 2026
@steipete steipete changed the title fix(bun): preserve Node worker dependencies and spawn diagnostics fix(runtime): preserve Node worker dependencies and failure diagnostics Sep 22, 2026
@steipete
steipete force-pushed the codex/bun-compatibility-runtime-fixes-73f branch from 4371594 to dadbd4e Compare September 22, 2026 07:36
@steipete steipete changed the title fix(runtime): preserve Node worker dependencies and failure diagnostics fix(runtime): preserve Node dependencies and queued SQLite context Sep 22, 2026
@steipete
steipete force-pushed the codex/bun-compatibility-runtime-fixes-73f branch from d0d5e62 to 673d3a3 Compare September 22, 2026 08:17
@steipete steipete changed the title fix(runtime): preserve Node dependencies and queued SQLite context fix(runtime): preserve Node worker dependencies and failure diagnostics Sep 22, 2026
@steipete
steipete force-pushed the codex/bun-compatibility-runtime-fixes-73f branch from 673d3a3 to 990b204 Compare September 22, 2026 09:09
@steipete steipete changed the title fix(runtime): preserve Node worker dependencies and failure diagnostics fix(runtime): preserve worker dependencies and retained agent databases Sep 22, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 22, 2026
@steipete
steipete force-pushed the codex/bun-compatibility-runtime-fixes-73f branch from 990b204 to 452f4f1 Compare September 22, 2026 10:48
@steipete steipete changed the title fix(runtime): preserve worker dependencies and retained agent databases fix(runtime): preserve Node worker dependencies and cleanup diagnostics Sep 22, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 22, 2026
Include status, signal, stdout, and stderr when the history benchmark subprocess fails. Keep both profiles, every assertion, and the existing 30-second child and 35-second test deadlines unchanged. This exposes the failing phase without claiming to fix the timeout.
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M and removed size: S labels Sep 22, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 22, 2026
@steipete steipete closed this Sep 22, 2026
@steipete steipete reopened this Sep 22, 2026
Preserve the independently reviewed c134c8d7 tree while adopting the canonical embeddings cleanup and history benchmark repairs from main. Retain the existing PR ancestry for GitHub head synchronization.
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed gateway Gateway runtime size: M labels Sep 22, 2026
Resolve the mainline diagnostics extraction by keeping spawn-diagnostics.ts as the sole owner and retaining the Bun family classification and existing regression assertions. The other compatibility changes are unchanged. Independent P0-P2 review and targeted formatting passed; refreshed hosted CI is required before landing.
Merge main including 3a4bbc6, which restores the SQLite reader context and spawn diagnostics to the extracted PR wrapper source inventory. The eight-file Bun compatibility patch retains identical stable patch ID 43645b39aa8a317656d1047afccfa79137314e66 and its existing reviews. Refresh hosted CI before landing.
@steipete
steipete merged commit f85b541 into main Sep 22, 2026
362 of 364 checks passed
@steipete
steipete deleted the codex/bun-compatibility-runtime-fixes-73f branch September 22, 2026 23:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '7d7f977ccfc1ac177526232e4f4960febd010015': (91 commits)
  test: avoid unused target setup in package profile fixtures (#155972)
  fix(worktrees): batch snapshot metadata reads
  test(plugin-state): distinguish borrowed and foreign lifecycle owners
  refactor(agents): share external harness session and attempt machinery (#152181)
  chore(i18n): refresh native locales (#156006)
  chore(test): retain Doctor fixture settlement diagnostics (#155944)
  perf(codex): reuse unchanged inference request bytes (#155987)
  perf(test): prepare snapshot ownership subprocess imports (#155973)
  perf(test): consolidate channel registry coverage (#155014)
  fix(runtime): preserve Node worker dependencies and cleanup diagnostics (#155292)
  perf(test): prepare worktree GC child runtime (#155928)
  fix(ui): open browser cards after delayed panel renders (#153253)
  fix(update): retain the running updater by hard link instead of copying the package (#155977)
  feat(decisions): add explicit evaluation and Labs opt-in foundation (#155134)
  fix(state): preserve lifecycle custody across worker dispatch
  improve: reuse shared tooling fixtures and defer legacy updater proof (#155731)
  improve(ui): reduce real-Gateway test preparation (#155979)
  perf(state): move session RPC SQL off the Gateway main thread (#155740)
  docs(freebsd): explain native Codex runtime limits (#155980)
  fix(qa): count Code Mode nested tool activity as transcript tool evidence (#155976)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…cs (openclaw#155292)

* fix(bun): preserve Node worker dependencies and spawn diagnostics

* fix(models): preserve nested catalog cleanup diagnostics

* test(gateway): own pending embeddings provider cleanup

* test(bench): retain subprocess failure diagnostics

Include status, signal, stdout, and stderr when the history benchmark subprocess fails. Keep both profiles, every assertion, and the existing 30-second child and 35-second test deadlines unchanged. This exposes the failing phase without claiming to fix the timeout.

* chore: reconcile Bun compatibility with current main

Preserve the independently reviewed c134c8d7 tree while adopting the canonical embeddings cleanup and history benchmark repairs from main. Retain the existing PR ancestry for GitHub head synchronization.

* fix(runtime): preserve Bun diagnostics after owner extraction

Resolve the mainline diagnostics extraction by keeping spawn-diagnostics.ts as the sole owner and retaining the Bun family classification and existing regression assertions. The other compatibility changes are unchanged. Independent P0-P2 review and targeted formatting passed; refreshed hosted CI is required before landing.

* chore: adopt canonical PR wrapper inventory repair

Merge main including 4ae90d3, which restores the SQLite reader context and spawn diagnostics to the extracted PR wrapper source inventory. The eight-file Bun compatibility patch retains identical stable patch ID 43645b39aa8a317656d1047afccfa79137314e66 and its existing reviews. Refresh hosted CI before landing.

Co-authored-by: Peter Steinberger <[email protected]>
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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: S 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