#6923

fix(runtime): admit Node 26 compatibility for Bun and accept --mcp registrations

DraftErcaner1988wants to merge intofrom

Summary

Admit Node 26 compatibility for Bun 1.4+ in supportsJavaScriptRuntime, allow the --mcp flag alongside mcp in direct launcher inspection, recognize bun and node interpreters for direct registrations, and update CLI version report test assertions when executed under Bun.

Problem and expected behavior

  1. Upstream commit 28a33cae8 bumped SUPPORTED_NODE_VERSION_RANGE to ^22.23.4 || ^24.22.1 || >=26.12.1. Bun 1.4 releases report Node compatibility 26.3.0 (process.versions.node), which is tracked separately from Node patch releases. As a result, running rea doctor or rea --version --json under Bun 1.4 classified the runtime as unsupported (satisfied: false) even though Bun 1.4 is fully capable and healthy.
  2. Direct launcher registrations using bun or bun.exe and the documented --mcp flag (which scripts/rea.mjs explicitly checks: args[0] === "--mcp" || args[0] === "mcp") were marked unknown or stale because inspectDirectRegistrationCommand only checked "mcp" and expected interpreterIdentity === "owned".
  3. In tests/boundary/cli/versionReportCli.test.ts, the assertion hardcoded runtime: { id: "node", version: process.versions.node }, which fails when tests run in a Bun-powered environment where process.versions.bun is defined.

Change and scope

  • Added SUPPORTED_BUN_NODE_COMPATIBILITY_RANGE = "^22.23.4 || ^24.22.1 || >=26.0.0". supportsJavaScriptRuntime now evaluates Bun's nodeCompatibilityVersion against this range, preserving Node engine patch floors for Node.js while admitting modern Bun releases.
  • Extended inspectDirectRegistrationCommand in src/application/ClientRegistrationIdentity.ts to accept --mcp in addition to mcp and recognize standard JavaScript runtimes (node, bun).
  • Added test case for Bun 1.4.3 (nodeCompatibilityVersion: 26.3.0) in src/domain/runtimeVersion.test.ts.
  • Updated tests/boundary/cli/versionReportCli.test.ts to assert the expected runtime dynamically based on process.versions.bun.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/runtimeVersion.ts, src/application/ClientRegistrationIdentity.ts
  • Contribution scope fit and linked maintainer decision: ordinary runtime fix and registration alignment; not applicable
  • CLI and MCP/tool-catalog contract: preserved
  • Provider, bridge, target-format, or platform compatibility: enables full support for Bun 1.4+ on Windows/macOS/Linux
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Target selection, authority, upstream behavior, and cleanup details: not applicable
  • Generated metadata, package, or installation impact: none

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Tests added or updated:
    • src/domain/runtimeVersion.test.ts: Added Bun 1.4.3 Node compatibility 26.3.0 test case (27 passed).
    • tests/boundary/cli/versionReportCli.test.ts: Passes under both Node and Bun environments.
  • User-visible CLI/MCP output: rea doctor --provider ghidra --json reports: {"name":"node","ok":true,"classification":"healthy","detail":"Bun 1.4.3 (Node.js 26.3.0 compatibility)"} and local client registrations with bun and --mcp report "state": "aligned".

Validation performed

  • vitest run src/domain/runtimeVersion.test.ts — 27 tests passed.
  • vitest run src/domain/versionReport.test.ts tests/boundary/cli/versionReportCli.test.ts — 4 tests passed.
  • tsc -p tsconfig.build.json — passed cleanly with 0 errors.
  • oxlint --fix && oxfmt — passed on all staged files.
  • bun --bun scripts/rea.mjs doctor --provider ghidra --json — reports healthy: true and aligned clients.

Compatibility, safety, and release

  • Breaking changes or migration steps: None.
  • Real Hopper/Ghidra, browser, or OS coverage: Verified on Windows x64 with Ghidra 12.1.4 and Bun 1.4.3.
  • Package or release metadata impact: None.
  • Security, privacy, process, or containment review: Standard runtime check adjustments.

Author readiness

Human owner: @Ercaner1988

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Activity

12
Ercaner19881mo ago

Addresses design and architectural considerations detailed in #6953.

greptile-apps[bot]1mo ago

Confidence Score: 5/5

[Medium impact] No new blocking issue was established in the changes since the previous review.

Summary

Adds Node/Bun and Python setup choices, broadens Bun compatibility checks, and recognizes more launcher forms.

  • Setup can choose a JavaScript runtime and Python toolchain for agent registrations.
  • Bun compatibility checks use a range that accepts Bun’s reported Node 26.3.0 version.
  • Direct client registrations recognize --mcp and Node.js or Bun runtime names.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Setup flags or profile questions] --> B[Choose runtime and Python settings]
  B --> C[Build registration command]
  B --> D[Build requested environment]
  D --> E[Merge with saved settings]
  C --> F[Show setup plan]
  E --> F
  F --> G{Approved?}
  G -- Yes --> H[Write selected client registrations]
  G -- No --> I[Return without writing]

Reviews (5) · Last reviewed commit: "fix(setup): make pythonRunner none clear..." · Reviewed by Greptile

greptile-apps[bot]reviewed1mo ago
chatgpt-codex-connector[bot]29d ago

Codex Review Summary

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

ReviewStatusCommitReview trigger
📝 Code Review⚠️ Failed 2026-10-27T10:12:24.544400Z
We couldn’t complete this review. Comment @codex review to try again.
0d1850cDraft 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.

chatgpt-codex-connector[bot]29d ago

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. Repo admins can enable using credits for code reviews in their settings.

Ercaner198828d ago

Follow-up from a local run on main at 570abe95f (REA 6.8.0), Windows 11 x64.

  1. Bun 1.4.4 still reports node_compatibility_version 26.3.0 (process.version is v26.3.0). On main, rea doctor --provider ghidra --json marks the node check ok: false against the 26.12.1 threshold. The range in this PR (>=26.0.0) would admit that version.
  2. A separate, unrelated Bun failure: scripts/lib/verifier-source-loader.mjs imports registerHooks from node:module, which Bun 1.4.3 and 1.4.4 do not export. The build chain stops at scripts/generate-skill-metadata.mjs. Reproduction and details are in a separate issue.
CassieFox2317d ago

TL;DR: I ran the PR's 4 changed test files on Node 22.23.4, 24.22.1 and 26.12.1, and all 34 tests passed on each. From reading the code, the None / Skip Python choice sets up the same environment as Standard. I did not run rea setup itself.

Edit (8 Nov): I ran the new head, 5bc9a5f76e, in a VM, and the results are here.

I tested head 770c0494b6 in a VM.

CheckNode 22.23.4Node 24.22.1Node 26.12.1
4 changed test filespass: 4 files, 34 testspass: 4 files, 34 testspass: 4 files, 34 tests

The 4 files are src/application/SetupPythonEnvironment.test.ts, src/domain/runtimeVersion.test.ts, src/domain/versionReport.test.ts and tests/boundary/cli/versionReportCli.test.ts.

The None / Skip choice looks like a no-op. The PR body (line 22) offers three Python choices in interactive setup: Standard / System Python (Default), uv + ruff and None / Skip. From reading the code, src/application/Setup.ts line 142 acts on the Python choice only when it is "uv". It then sets REA_PYTHON_RUNNER to "uv" and may set REA_PWNTOOLS_PYTHON. No other file under src handles "none" for the Python runner. The word appears only in the types (SetupTypes.ts line 251, interactiveSetup.ts line 38). So None / Skip would set up the Standard environment. I did not run this case.

One idea: either make "none" do something, for example skip Python-backed tools, or drop the choice. Add a test for whichever one you pick.

CI on 770c0494b6:

  • CI, CodeQL production and PR title are waiting for a maintainer to approve them (action_required).
  • PR readiness has 2 successful runs and 1 failed run, and its commit status is success.
  • Validate author declaration has 2 successful check runs and 1 failed one.
  • Greptile Review passed.

Merge state: the head is 303 commits behind main b81da90354. GitHub says the PR is mergeable, and its merge state is blocked.

Not run

  • rea setup itself, interactive or with --quick, with Bun or with uv.
  • The None / Skip Python choice.
  • A merge with current main, b81da90354.
Test setup
  • Box: Fedora 44 VM (4 vCPUs, 8 GB) on my Nobara 44 PC, Linux 7.2.11
  • Node: 22.23.4, 24.22.1, 26.12.1
  • Head / base: 770c0494b6 / 47cedcc93a (merge base with main)
  • Install: npm ci --offline and npm run test:prepare on Node 24.22.1, exit 0
Commands
npm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/application/SetupPythonEnvironment.test.ts src/domain/runtimeVersion.test.ts src/domain/versionReport.test.ts tests/boundary/cli/versionReportCli.test.ts

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

Ercaner198817d ago

Thanks for the thorough review and testing across Node 22/24/26, @CassieFox23!

Addressed in commit 5bc9a5f76:

  1. Handled one explicitly in Setup.ts: Choosing one now explicitly purges any inherited REA_PWNTOOLS_PYTHON from the client's providerEnvironment and records REA_PYTHON_RUNNER=none. This ensures Python-backed tools (pwntools/pwndbg) are cleanly skipped and no Python path leaks into the registered client configuration.
  2. Accessible setup alignment: Added the corresponding skip option to the accessible sequential flow in interactiveSetup.ts.
  3. Unit tests added: Added test coverage in src/application/Setup.configuration.test.ts verifying that one clears REA_PWNTOOLS_PYTHON and sets REA_PYTHON_RUNNER=none, while uv continues to populate the discovered path. All 34 tests + 31 setup configuration tests pass.
CassieFox2317d ago

TL;DR: Thanks, Ercaner1988: on the new head 5bc9a5f76e, the PR's 5 changed test files pass. Node 22.23.4, 24.22.1 and 26.12.1 each ran 5 test files and 65 tests, and all passed. The CI run is completed/action_required, and no CI test jobs appear.

Findings

CheckNode 22.23.4Node 24.22.1Node 26.12.1
Focused run of the 5 changed test filespass: 5 of 5 files, 65 of 65 testspass: 5 of 5 files, 65 of 65 testspass: 5 of 5 files, 65 of 65 tests

The five files are src/application/Setup.configuration.test.ts, src/application/SetupPythonEnvironment.test.ts, src/domain/runtimeVersion.test.ts, src/domain/versionReport.test.ts and tests/boundary/cli/versionReportCli.test.ts.

The PR changes 15 files against the merge base 47cedcc93a. Five are test files and ten are others.

CI on 5bc9a5f76e:

  • The workflow runs CI, CodeQL production and PR title are completed/action_required.
  • The workflow run PR readiness is completed/success, and the commit status PR readiness is success.
  • The check runs Greptile Review and Validate author declaration are success.
  • No Source tests, Portable tests or Test shard jobs appear in the CI check runs.
  • Mergeable is true, and the merge state is blocked.

The head is 336 commits behind main c78c8aed40.

Not run

  • A probe that searches for any reader of REA_PYTHON_RUNNER and checks whether it accepts none
  • A run that deletes the else if block at Setup.ts:151-158 and reruns src/application/Setup.configuration.test.ts, to confirm the "none" test fails
  • A merge with current main, c78c8aed40.
Test setup
  • Box: Fedora 44 VM (4 vCPUs, 8 GB) on my Nobara 44 PC, Linux 7.2.11
  • Node: 22.23.4, 24.22.1, 26.12.1
  • Head / base: 5bc9a5f76e / 47cedcc93a (merge base with main)
  • Install: npm ci --offline and npm run test:prepare on Node 24.22.1
Commands
npm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/application/Setup.configuration.test.ts src/application/SetupPythonEnvironment.test.ts src/domain/runtimeVersion.test.ts src/domain/versionReport.test.ts tests/boundary/cli/versionReportCli.test.ts

🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊

This pull request is a draft

Merging is unavailable until it is marked ready for review.