fix(infra): resolve macOS product version via sw_vers for runtime prompt#95158
fix(infra): resolve macOS product version via sw_vers for runtime prompt#95158lzyyzznl wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 20, 2026, 1:29 AM ET / 05:29 UTC. Summary PR surface: Source +20. Total +20 across 4 files. Reproducibility: yes. from source inspection: current main passes raw Review metrics: 1 noteworthy metric.
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 runtime OS label helper used by all three prompt paths, add focused Darwin/non-Darwin regression tests, and require redacted macOS/Darwin after-fix prompt proof before merge. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main passes raw Is this the best way to solve the issue? No as submitted; using the macOS product version is the right boundary, but the maintainable fix needs caching, focused helper coverage, and real macOS/Darwin prompt proof before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8e375242bed2. Label changesLabel justifications:
Evidence reviewedPR surface: Source +20. Total +20 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
|
- Add resolveRuntimeOsLabel() to src/infra/os-summary.ts that uses sw_vers -productVersion on Darwin instead of os.release() which returns the Darwin kernel version (e.g. 25.5.0) - Replace os.type() + os.release() with resolveRuntimeOsLabel() in cli-runner/helpers.ts, attempt.ts, and compact.ts runtime paths - On macOS 26 (Tahoe) this correctly shows "macOS 26.5.1" instead of "Darwin 25.5.0" in agent runtime prompts Fixes openclaw#95145
d1984c9 to
ada14fd
Compare
|
Superseded by #95234 — same fix, cleaner patch. |
Summary
On macOS 26 (Tahoe), Darwin kernel version 25.x no longer maps to macOS marketing version 26.x —
os.release()returns25.5.0while the actual product version is26.5.1. The runtime prompt paths (cli-runner/helpers.ts,attempt.ts,compact.ts) directly concatenatedos.type()+os.release(), producingDarwin 25.5.0in agent runtime context instead of the correctmacOS 26.5.1.The fix adds
resolveRuntimeOsLabel()tosrc/infra/os-summary.tsthat usessw_vers -productVersionon Darwin (matching the pattern already used byresolveOsSummary()andsystem-presence.ts) and falls back to the existing format on other platforms. All three runtime prompt callers are updated to use this shared function.Fixes #95145
Real behavior proof
Behavior addressed: On macOS 26 (Tahoe) hosts, agent runtime prompts now show the correct macOS product version (e.g. "macOS 26.5.1") instead of the Darwin kernel version (e.g. "Darwin 25.5.0").
Real environment tested: Linux 6.8.0 (Node v24), macOS verification relies on the same
sw_vers -productVersionmechanism already proven byresolveOsSummary()andsystem-presence.tsExact steps or command run after this patch: node -e "console.log(require('os').type(), require('os').release())" + pnpm tsgo + pnpm test src/infra/os-summary.test.ts + pnpm test src/agents/system-prompt-params.test.ts
After-fix evidence:
Observed result after the fix: On Linux/Windows,
resolveRuntimeOsLabel()produces exactly the same output as the prioros.type() + os.release()— no regression. On Darwin (macOS 26 Tahoe), the same function now correctly returnsmacOS <productVersion>viasw_vers -productVersioninstead of the Darwin kernel version fromos.release(), matching the proven pattern inresolveOsSummary()andsystem-presence.ts.What was not tested: This fix could not be verified on an actual macOS 26 (Tahoe) host due to the absence of such a test environment. The fix relies on the identical
sw_vers -productVersionmechanism already proven byresolveOsSummary()andsystem-presence.tsin production, which correctly return the macOS product version on all supported macOS versions.Tests and validation
Unit tests
All 14 tests across 4 test files pass:
TypeScript check
Code changes
Risk checklist
resolveRuntimeOsLabel()function falls back to the existingos.type() + os.release()format on non-Darwin platforms; on Darwin it matches the provensw_verspattern already in use byresolveOsSummary()Current review state