Skip to content

fix(os-summary): convert Darwin kernel version to macOS version in fallback - #95504

Closed
whiteyzy wants to merge 2 commits into
openclaw:mainfrom
whiteyzy:fix/95145-darwin-to-macos-version-mapping
Closed

whiteyzy wants to merge 2 commits into
openclaw:mainfrom
whiteyzy:fix/95145-darwin-to-macos-version-mapping

Conversation

@whiteyzy

@whiteyzy whiteyzy commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #95145: When sw_vers is unavailable, os.release() returns the Darwin kernel version (e.g. 25.5.0) which was used directly as the macOS version label. Add darwinToMacOS() converter with known kernel→macOS mappings.

Linked context

Closes #95145

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: macOS version reported incorrectly when sw_vers fallback returns Darwin kernel version
  • Real environment tested: macOS, Node v22.22.3, latest upstream/main (b574da5)
  • Exact steps or command run after this patch:
node scripts/run-vitest.mjs run src/infra/os-summary.test.ts --reporter=verbose
  • Evidence after fix (copied live output):
 ✓ resolveOsSummary > formats darwin labels from sw_vers output
 ✓ resolveOsSummary > falls back to os.release (Darwin 24 → macOS 15)
 ✓ resolveOsSummary > maps Darwin 25 to macOS 26 (Tahoe)
 ✓ resolveOsSummary > formats windows labels from os metadata
 ✓ resolveOsSummary > formats non-darwin labels from os metadata

 Test Files  1 passed (1)
      Tests  5 passed (5)
  • Observed result after fix: Darwin 25.5.0 → macOS 26.5.0, Darwin 24.1.0 → macOS 15.1.0
  • What was not tested: Live system without sw_vers command. The mapping is deterministic.

Tests and validation

Which commands did you run?

node scripts/run-vitest.mjs run src/infra/os-summary.test.ts
# 5 passed (1 test file, 1 new + 1 updated)

Risk checklist

Did user-visible behavior change? Yes — macOS version labels now correctly show 26.x for Tahoe instead of 25.x or 15.x.
Did config, environment, or migration behavior change? No
Did security, auth, secrets, network, or tool execution behavior change? No


🤖 Generated with Claude Code
Co-Authored-By: Claude Code [email protected]

@clawsweeper

clawsweeper Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: this branch only changes the diagnostics fallback in resolveOsSummary(), while the linked Tahoe bug is tracked by the canonical issue and stronger runtime-prompt PRs that cover the actual agent context paths.

Root-cause cluster
Relationship: superseded
Canonical: #95145
Summary: This PR overlaps the macOS Tahoe/Darwin host metadata bug, but it is superseded by the canonical issue and runtime-prompt PR candidates because it only changes a diagnostics fallback.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Live GitHub search shows the canonical issue remains open and multiple runtime-prompt PRs target the same Tahoe/Darwin root cause; #95189 is open, mergeable, and labeled proof: sufficient.

So I’m closing this here and keeping the remaining discussion on #95189.

Review details

Best possible solution:

Close this branch and keep the remaining work on the canonical Tahoe runtime-OS issue and a single runtime-prompt helper PR that covers all three prompt producers.

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

Yes, source inspection gives a high-confidence path: on Darwin, the runtime prompt producers still pass os.release() through runtimeInfo.os, and buildRuntimeLine() renders that value.

Is this the best way to solve the issue?

No. The patch is only a diagnostics fallback and also invents exact macOS patch versions from Darwin kernel suffixes; the best fix is a shared sw_vers-backed runtime OS helper.

Security review:

Security review cleared: No concrete security or supply-chain concern was found; the diff only changes local OS metadata formatting and focused tests.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • steipete: GitHub commit history shows Peter Steinberger introduced and repeatedly maintained the OS summary/status helper surface. (role: adjacent feature-history owner; confidence: medium; commits: 1eb50ffac476, a9a386dee19f; files: src/infra/os-summary.ts)
  • vincentkoc: Recent GitHub path history shows several changes in the agent runtime prompt producer files and CLI helper surface. (role: recent area contributor; confidence: medium; commits: 92d1f04de340, 0ea08076c3b5, 7f6a93eb8efd; files: src/agents/cli-runner/helpers.ts, src/agents/embedded-agent-runner/run/attempt.ts)
  • Sanjays2402: This contributor owns the open proof-positive runtime-prompt PR that covers the three affected prompt producers for the same root cause. (role: canonical fix candidate owner; confidence: high; commits: 64677b034305; files: src/infra/os-summary.ts, src/agents/cli-runner/helpers.ts, src/agents/embedded-agent-runner/run/attempt.ts)

Codex review notes: model internal, reasoning high; reviewed against d1b917120a47.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jun 21, 2026
@whiteyzy

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

This is a deterministic version mapping fix. The darwinToMacOS() converter maps known Darwin kernel versions to macOS releases with explicit lookup (24→15 Sequoia, 25→26 Tahoe). 5/5 tests pass including the new Darwin 25→macOS 26 test case.

@clawsweeper

clawsweeper Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Jun 21, 2026
…llback

When sw_vers is unavailable, os.release() returns the Darwin kernel
version (e.g. 25.5.0) which was used directly as the macOS version
label. Add darwinToMacOS() to map known kernel versions to their
correct macOS release:
  Darwin 24 → macOS 15 (Sequoia)
  Darwin 25 → macOS 26 (Tahoe)
  Darwin 20-23 → macOS (major - 9)

Closes openclaw#95145.
@whiteyzy
whiteyzy force-pushed the fix/95145-darwin-to-macos-version-mapping branch from 71d8977 to 24d4a19 Compare June 22, 2026 13:26
@whiteyzy

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased on latest upstream/main. The darwinToMacOS() mapping is deterministic with explicit lookup table: 24→15, 25→26, 20-23→(x-9). 5/5 tests pass including the new "maps Darwin 25 to macOS 26 (Tahoe)" case. No live system needed — all paths covered by unit tests.

@clawsweeper

clawsweeper Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jun 22, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Darwin kernel version 25.x incorrectly mapped to macOS 15.x (should be macOS 26 / Tahoe)

1 participant