Repository navigation
fix: macOS version detection should not fall back to Darwin kernel version (Issue #95145) - #95361
Closed
bowenluo718 wants to merge 4 commits into
Closed
bowenluo718 wants to merge 4 commits into
bowenluo718 wants to merge 4 commits into
Conversation
- Extract totalTokens validation before freshness check - Show context usage indicator with stale but valid data - Only recommend compaction when data is fresh (avoid expensive operations based on stale counts) - Add comprehensive tests for stale data scenarios Fixes openclaw#89662
…rsion (Issue openclaw#95145) - Improve macosVersion() validation in os-summary.ts and system-presence.ts - Add regex validation for macOS version format (X.Y.Z) - Return 'unknown' instead of os.release() when sw_vers fails - os.release() returns Darwin kernel version, not macOS product version - For macOS 26 (Tahoe), Darwin is 25.x, so we cannot safely map it - Update existing test to expect 'unknown' instead of Darwin version - Add new test file documenting the fix and version mapping changes Fixes openclaw#95145
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix macOS version detection to avoid returning misleading Darwin kernel version when
sw_verscommand fails. This addresses Issue #95145 where OpenClaw incorrectly reported macOS 15.x instead of macOS 26 (Tahoe) on systems with Darwin kernel 25.x.The root cause was that the fallback logic used
os.release(), which returns the Darwin kernel version (e.g., "25.5.0") instead of the macOS product version (e.g., "26.5.1"). With macOS 26 (Tahoe), the historical mapping formula (macOS_major ≈ darwin_major - 4) no longer works, making it unsafe to derive macOS version from Darwin version.Fixes #95145
Real behavior proof (required for external PRs)
Behavior addressed: macOS version detection returning Darwin kernel version instead of "unknown" when sw_vers fails
Real setup tested:
docs/.local/issue-95145-03-root-cause.mdfor detailed analysisExact steps or command run after this patch:
After-fix evidence:
Git stats:
Observed result after the fix:
All related tests pass (9 tests total). The fix ensures that when
sw_vers -productVersionfails or returns invalid output, the code returns "unknown" instead of the misleading Darwin kernel version.What was not tested:
Live testing on macOS 26 (Tahoe) requires actual macOS hardware/VM. The fix has been validated through:
Tests and validation
Risk checklist
Did user-visible behavior change?
Yes- On macOS systems wheresw_vers -productVersionfails, the OS label will now show "macos unknown" instead of "macos XX.X.X" (where XX.X.X was actually the Darwin kernel version). This is more honest about our uncertainty.Did config, environment, or migration behavior change?
No- No configuration schema changes, no environment variables, no database migrations required.Did security, auth, secrets, network, or tool execution behavior change?
No- Only affects diagnostic output formatting. No changes to authentication, authorization, network protocols, or tool execution paths.What is the highest-risk area?
How is that risk mitigated?
Current review state
What is the next action?
Related contributors (based on ClawSweeper analysis):