fix(infra): use macOS product version in os summary diagnostics (related #95145)#95170
fix(infra): use macOS product version in os summary diagnostics (related #95145)#95170zenglingbiao wants to merge 3 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 11:26 PM ET / 03:26 UTC. Summary PR surface: Source +6, Tests +2. Total +8 across 4 files. Reproducibility: yes. from source and reporter evidence: current main passes raw os.release() into status metadata and runtime prompts, and the linked issue provides macOS 26.5.1 versus Darwin 25.5.0 host output. I did not run a live macOS 26 reproduction in this checkout. Review metrics: 2 noteworthy metrics.
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 findings
Review detailsBest possible solution: Land one cached macOS product-version helper with explicit status metadata semantics, route every runtime prompt caller through the correct display shape, and add redacted macOS/OpenClaw proof before merging. Do we have a high-confidence way to reproduce the issue? Yes, from source and reporter evidence: current main passes raw os.release() into status metadata and runtime prompts, and the linked issue provides macOS 26.5.1 versus Darwin 25.5.0 host output. I did not run a live macOS 26 reproduction in this checkout. Is this the best way to solve the issue? No. Updating Darwin OsSummary.release is a useful partial fix, but the best fix should use a cached macOS display helper, cover compaction, and prove the changed Darwin path on macOS. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c946df023917. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +6, Tests +2. Total +8 across 4 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
|
…win-kernel-version
fixes openclaw#95145) - Cache macosVersion() result to avoid double sw_vers probe - Route cli-runner and embedded attempt OS fields through resolveOsSummary - Update os-summary test expectations for darwin release = product version
|
@clawsweeper re-review Updated:
All 4 tests pass, build passes. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Scoped to diagnostics/runtime-prompt metadata. Removed closing reference — changed from "Fixes" to "Related to" #95145. |
|
Superseded by #95189 which provides the superior cached resolveRuntimePromptOs() approach covering all three runtime prompt callers (CLI, embedded attempt, compaction) with proper Map-level caching, comprehensive tests, and real macOS proof (🐚 platinum hermit, 🦞 proof). Per ClawSweeper's maintainer option 3: "Consolidate With Runtime PR." |
Summary
resolveOsSummary()reports the Darwin kernel version (e.g. "25.5.0") as thereleasefield instead of the macOS product version ("26.5.1"). Starting with macOS 26, Darwin kernel 25.x no longer maps to the macOS major version using the old convention, causing downstream diagnostics to display incorrect OS versions.resolveOsSummaryunconditionally assignedos.release()to thereleasefield. On macOS, this is the Darwin kernel version. ThemacosVersion()helper (which callssw_vers -productVersion) already existed but was only used for thelabelfield.macosVersion()for thereleasefield on darwin, cached once per call to avoid doublesw_versprobe. Routecli-runnerandembedded attemptruntime OS fields throughresolveOsSummary().releaseto propagate the product version to agent prompt metadata.os.release()consumers — the linked issue may still need additional work for other code paths.src/infra/os-summary.ts— darwinreleaseusesmacosVersion()(cached)src/agents/cli-runner/helpers.ts— runtime OS viaresolveOsSummary().releasesrc/agents/embedded-agent-runner/run/attempt.ts— runtime OS viaresolveOsSummary().releasesrc/infra/os-summary.test.ts— updated darwin expectationsos.release()still used on non-darwinReal behavior proof
Behavior or issue addressed (#95145):
resolveOsSummary()returns Darwin kernel version asreleaseon macOS, causing incorrect version reporting on macOS 26 where kernel 25 ≠ macOS 15.Real environment tested: Linux, Node v22.22.0, OpenClaw built from source. Non-darwin backward compatibility verified —
release=os.release()on Linux. The darwin code path uses the existingmacosVersion()helper which callssw_vers -productVersion.Exact steps or command run after this patch: ran
node --import tsx proof.mjs— confirmed non-darwin path unchanged.Evidence after fix:
Observed result after fix: On darwin,
releasenow usessw_vers -productVersioninstead ofos.release(). On Linux/Windows,os.release()continues to be used.What was not tested: Live
sw_verson macOS 26 hardware. The fix is validated by source analysis (reporter confirmedsw_vers -productVersion→ "26.5.1" vsuname -r→ "25.5.0"), test updates (4 tests pass), and the non-darwin path remains unchanged.Repro confirmation:
os-summary.test.ts— darwin expectations updated, all 4 tests pass.Change Type
Scope
Regression Test Plan
node scripts/run-vitest.mjs src/infra/os-summary.test.tsReview Findings Addressed
N/A (initial submission)
Linked Issue/PR
Related to #95145