Skip to content

fix(doctor): avoid duplicate gateway runtime warnings#79203

Merged
steipete merged 1 commit into
mainfrom
fix/gateway-doctor-runtime-warning
May 8, 2026
Merged

fix(doctor): avoid duplicate gateway runtime warnings#79203
steipete merged 1 commit into
mainfrom
fix/gateway-doctor-runtime-warning

Conversation

@steipete

@steipete steipete commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: gateway doctor could emit duplicate Node runtime warnings when the install plan had already selected a supported Node runtime.
  • Why it matters: users saw contradictory/noisy repair guidance during daemon migration.
  • What changed: the fallback warning is skipped when the runtime choice is already node, and the duplicate generic warning is only emitted when no specific warning is available.
  • What did NOT change: doctor still warns when migration is needed and no supported system Node can be found.

Verification

  • git diff --check origin/main..HEAD
  • pnpm test src/commands/doctor-gateway-services.test.ts — 25 passed
  • node -e 'console.log(process.platform, process.version)'darwin v25.9.0

Real behavior proof

  • Behavior or issue addressed: gateway doctor runtime repair no longer prints duplicate Node migration warnings after the install plan already selected Node.
  • Real environment tested: local macOS checkout running the doctor helper regression against the real repository code.
  • Exact steps or command run after this patch: pnpm test src/commands/doctor-gateway-services.test.ts
  • Evidence after fix: terminal output: Test Files 1 passed (1); Tests 25 passed (25)
  • Observed result after fix: the regression path proves only the install-plan runtime note remains and the duplicate doctor warning is absent.
  • What was not tested: installing/reinstalling a real gateway daemon service.

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Risks and Mitigations

  • Risk: suppressing too much warning text.
    • Mitigation: the guard is scoped to runtimeChoice === "node"; unsupported/missing Node still warns.

Linked Issue

Closes #79243

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels May 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a2f9a3bee

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

: null;
const systemNodePath = systemNodeInfo?.supported ? systemNodeInfo.path : null;
if (needsNodeRuntime && !systemNodePath) {
if (needsNodeRuntime && !systemNodePath && runtimeChoice !== "node") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve missing-system-node warning for node migration

The new guard runtimeChoice !== "node" suppresses this entire warning block for version-managed Node services, even when needsNodeRuntime is true and resolveSystemNodeInfo returns null (no system Node found). In that case buildGatewayInstallPlan does not emit a specific runtime warning either (because renderSystemNodeWarning(null) is empty), so the previous fallback guidance about installing system Node is now lost from the Gateway runtime notes. This is a behavior regression for users who only have version-manager Node installed and need migration guidance.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
This PR changes gateway doctor service repair to suppress duplicate Node runtime warnings, adds a focused regression test, and adds a changelog entry.

Reproducibility: yes. Source inspection gives a high-confidence path for both the reported duplicate warning on current main and the PR regression: with needsNodeRuntime === true, runtimeChoice === "node", and resolveSystemNodeInfo() returning null, the PR emits no replacement install guidance.

Real behavior proof
Needs real behavior proof before merge: Needs real behavior proof before merge: the PR body provides copied unit-test output only, so it needs redacted after-fix openclaw doctor or gateway repair terminal/log/screenshot/recording proof; after updating the PR body, ClawSweeper should re-review automatically, or a maintainer can comment @clawsweeper re-review.

Next step before merge
Human follow-up is needed because this open PR has a protected maintainer label, mock-only proof, and one P2 diagnostic regression to resolve.

Security
Cleared: The diff only changes doctor diagnostic flow, a focused unit test, and the changelog; it adds no dependencies, permissions, network calls, or secret-handling changes.

Review findings

  • [P2] Preserve missing-system-node runtime guidance — src/commands/doctor-gateway-services.ts:425
Review details

Best possible solution:

Keep the deduplication intent, but suppress the doctor fallback only when a specific install-plan runtime warning was actually emitted, and add coverage for the version-manager Node plus no-system-Node case.

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

Yes. Source inspection gives a high-confidence path for both the reported duplicate warning on current main and the PR regression: with needsNodeRuntime === true, runtimeChoice === "node", and resolveSystemNodeInfo() returning null, the PR emits no replacement install guidance.

Is this the best way to solve the issue?

No. The PR is close, but the runtimeChoice !== "node" guard is too broad; the safer fix is to dedupe based on whether another Gateway runtime warning was actually emitted while preserving missing-system-Node guidance.

Full review comments:

  • [P2] Preserve missing-system-node runtime guidance — src/commands/doctor-gateway-services.ts:425
    The new runtimeChoice !== "node" guard skips this whole warning block for version-manager Node services. If resolveSystemNodeInfo() returns null, the install-plan warning also emits nothing because renderSystemNodeWarning(null) is empty, so users lose the install guidance even though migration is still required.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.9

Acceptance criteria:

  • pnpm test src/commands/doctor-gateway-services.test.ts
  • git diff --check origin/main..HEAD

What I checked:

Likely related people:

  • steipete: Recent merged history repeatedly touches gateway install planning, Node runtime preference, runtime audit behavior, and the Node 22.16 floor that shape this warning path; this PR and the linked issue are also authored by this handle. (role: recent maintainer and domain owner; confidence: high; commits: 955b0256976a, d0ad5c3eaaef, 1cf85030172b; files: src/commands/doctor-gateway-services.ts, src/commands/daemon-install-helpers.ts, src/daemon/runtime-paths.ts)
  • vincentkoc: Recent commits in the same gateway doctor and daemon service-repair area adjusted noninteractive repair policy and launchd service startup behavior, making this a plausible review route for service-repair semantics. (role: recent adjacent maintainer; confidence: medium; commits: 24fc40b1332e, d7c173b69456, b258c3fc6578; files: src/commands/doctor-gateway-services.ts, src/commands/daemon-install-helpers.ts)
  • Val Alexander: Local blame in this checkout attributes the central warning block and related runtime helper lines to a broad current-main commit; because that commit spans many files, routing confidence is lower than the focused remote history. (role: current local implementation attribution; confidence: low; commits: d12c92c216ab; files: src/commands/doctor-gateway-services.ts, src/commands/daemon-install-helpers.ts, src/daemon/runtime-paths.ts)

Remaining risk / open question:

  • No live gateway doctor or daemon service run is attached to the PR, so after-fix runtime behavior is not real-environment proven.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0f31b6424ef9.

Re-review progress:

@steipete
steipete force-pushed the fix/gateway-doctor-runtime-warning branch 3 times, most recently from 985011f to ebc5b92 Compare May 8, 2026 05:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebc5b9274b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -422,15 +422,16 @@ export async function maybeRepairGatewayServiceConfig(
? await resolveSystemNodeInfo({ env: process.env })
: null;
const systemNodePath = systemNodeInfo?.supported ? systemNodeInfo.path : null;
if (needsNodeRuntime && !systemNodePath) {
if (needsNodeRuntime && !systemNodePath && runtimeChoice !== "node") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve missing-system-node warning during Node migration

The new runtimeChoice !== "node" guard suppresses this warning path when the service already runs node, but that is exactly the case for version-manager Node migrations. If needsNodeRuntime is true and resolveSystemNodeInfo returns null (no system Node installed), this branch now emits nothing, and buildGatewayInstallPlan also emits no runtime warning when renderSystemNodeWarning(null) is empty. In that scenario users lose the explicit install guidance despite a required migration path.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the fix/gateway-doctor-runtime-warning branch 3 times, most recently from 8bec5fe to 4ad7b51 Compare May 8, 2026 05:28
@steipete
steipete force-pushed the fix/gateway-doctor-runtime-warning branch from 4ad7b51 to 1f3d2d4 Compare May 8, 2026 05:34
@steipete
steipete merged commit bd3f09e into main May 8, 2026
110 checks passed
@steipete
steipete deleted the fix/gateway-doctor-runtime-warning branch May 8, 2026 05:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
rogerdigital pushed a commit to rogerdigital/openclaw that referenced this pull request May 9, 2026
lykeion-dev pushed a commit to lykeion-dev/openclaw--rev that referenced this pull request May 14, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway doctor duplicates Node runtime warnings

1 participant