fix(infra): use sw_vers productVersion for macOS release on Darwin 25+#95157
fix(infra): use sw_vers productVersion for macOS release on Darwin 25+#95157ZOOWH wants to merge 2 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 10:27 PM ET / 02:27 UTC. Summary PR surface: Source +38, Tests +99. Total +137 across 5 files. Reproducibility: yes. from source inspection and the linked report. Current main and v2026.6.8 still expose raw Darwin release values in Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical cached macOS product-version fix that covers both status release metadata and runtime prompt metadata, with redacted real macOS/OpenClaw proof, then reconcile the overlapping candidate PRs. Do we have a high-confidence way to reproduce the issue? Yes from source inspection and the linked report. Current main and v2026.6.8 still expose raw Darwin release values in Is this the best way to solve the issue? Yes as a code direction: a shared macOS product-version helper covering both OS summary release and runtime prompt labels is the narrowest maintainable fix. The PR still needs real macOS proof and maintainer consolidation among overlapping candidate PRs before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3518fa575a2f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +38, Tests +99. Total +137 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
9ae3010 to
6204076
Compare
On macOS 26 (Tahoe), Darwin kernel version 25.x no longer maps to the macOS marketing version 26.x. os.release() returns "25.5.0" while the actual product version is "26.5.1". The runtime prompt paths in cli-runner/helpers.ts, attempt.ts, and compact.ts directly concatenated os.type() + os.release(), producing "Darwin 25.5.0" in agent runtime context instead of the correct "macos 26.5.1". - Export resolveOsRelease() that prefers sw_vers -productVersion on Darwin, falling back to os.release() if sw_vers is unavailable. - Export resolveRuntimeOsLabel() that returns "macos <version>" on Darwin and os.type() + os.release() on other platforms. - Use resolveOsRelease() for OsSummary.release so openclaw status and diagnostics report the correct macOS version. - Replace os.type() + os.release() in all three runtime prompt paths with resolveRuntimeOsLabel() so agent context shows the correct macOS product version instead of raw Darwin kernel version. - Add unit tests for resolveOsRelease() and resolveRuntimeOsLabel() covering darwin with sw_vers, darwin fallback, linux, and win32. - Update resolveOsSummary test to verify release field uses resolveOsRelease() on darwin. Closes openclaw#95145
6204076 to
a9772f8
Compare
|
Closing in favor of stronger candidates — #95189 (🦐 gold shrimp) is closer to merge and I cannot provide live macOS proof to clear the needs-proof gate. |
Summary
os.release()returns the Darwin kernel version (e.g. "25.5.0") which no longer matches the macOS marketing version starting with macOS 26 (Tahoe / Darwin 25). The actual macOS version is "26.5.1" (viasw_vers -productVersion).resolveOsRelease()that preferssw_vers -productVersionon Darwin, falling back toos.release()ifsw_versis unavailable. On other platforms, returnsos.release()unchanged.resolveRuntimeOsLabel()that returns"macos <version>"on Darwin andos.type() + os.release()on other platforms.resolveOsRelease()for theOsSummary.releasefield soopenclaw status, diagnostics, and host detection report the correct macOS version.os.type() + os.release()in all three runtime prompt paths (cli-runner/helpers.ts,attempt.ts,compact.ts) withresolveRuntimeOsLabel()so agent context shows the correct macOS product version instead of raw Darwin kernel version.resolveOsRelease(darwin with sw_vers, darwin fallback, linux, win32) +resolveRuntimeOsLabel(darwin with sw_vers, darwin fallback, linux, win32) +resolveOsSummary(4 cases via it.each)Files changed
src/infra/os-summary.tsresolveOsRelease()andresolveRuntimeOsLabel(), useresolveOsRelease()inOsSummary.releasesrc/agents/cli-runner/helpers.ts`${os.type()} ${os.release()}`withresolveRuntimeOsLabel()src/agents/embedded-agent-runner/run/attempt.ts`${os.type()} ${os.release()}`withresolveRuntimeOsLabel()src/agents/embedded-agent-runner/compact.ts`${os.type()} ${os.release()}`withresolveRuntimeOsLabel()src/infra/os-summary.test.tsresolveOsRelease()andresolveRuntimeOsLabel(), updateresolveOsSummarytest dataReal behavior proof
Behavior addressed: Darwin kernel version 25.x is incorrectly mapped to macOS 15.x instead of macOS 26 (Tahoe). Both the
OsSummary.releasefield and the runtime promptosfield expose raw Darwin kernel versions instead of the macOS marketing version.Environment tested: Node v24.13.1 on Linux, vitest run with mocked platform/release/sw_vers +
node --import tsxcalling real production functions.Steps run after the patch:
Evidence after fix:
Unit test results (12/12 pass):
Production function output on Linux host:
Expected on macOS 26 Tahoe (Darwin 25.5.0, sw_vers returns 26.5.1):
What was not tested: Live macOS 26 Tahoe host (no access). The Darwin path uses the same
sw_vers -productVersionmechanism already validated by the existingresolveOsSummary()label andsystem-presence.ts.Closes #95145