File tree Expand file tree Collapse file tree
embedded-agent-runner/run Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import type { ThinkLevel } from "../../auto-reply/thinking.js";
1919import type { ChatType } from "../../channels/chat-type.js" ;
2020import type { CliBackendConfig } from "../../config/types.js" ;
2121import type { OpenClawConfig } from "../../config/types.openclaw.js" ;
22+ import { resolveOsSummary } from "../../infra/os-summary.js" ;
2223import { privateFileStore } from "../../infra/private-file-store.js" ;
2324import { tempWorkspace } from "../../infra/private-temp-workspace.js" ;
2425import { resolvePreferredOpenClawTmpDir } from "../../infra/tmp-openclaw-dir.js" ;
@@ -157,7 +158,7 @@ export function buildCliAgentSystemPrompt(params: {
157158 sessionKey : params . sessionKey ,
158159 sessionId : params . sessionId ,
159160 host : "openclaw" ,
160- os : `${ os . type ( ) } ${ os . release ( ) } ` ,
161+ os : `${ os . type ( ) } ${ resolveOsSummary ( ) . release } ` ,
161162 arch : os . arch ( ) ,
162163 node : process . version ,
163164 model : params . modelDisplay ,
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ import { isEmbeddedMode } from "../../../infra/embedded-mode.js";
4444import { formatErrorMessage } from "../../../infra/errors.js" ;
4545import { resolveHeartbeatSummaryForAgent } from "../../../infra/heartbeat-summary.js" ;
4646import { getMachineDisplayName } from "../../../infra/machine-name.js" ;
47+ import { resolveOsSummary } from "../../../infra/os-summary.js" ;
4748import { createCodexNativeWebSearchWrapper } from "../../../llm/providers/stream-wrappers/openai.js" ;
4849import type { AssistantMessage } from "../../../llm/types.js" ;
4950import { listRegisteredPluginAgentPromptGuidance } from "../../../plugins/command-registry-state.js" ;
@@ -1933,7 +1934,7 @@ export async function runEmbeddedAttempt(
19331934 sessionKey : params . sessionKey ,
19341935 sessionId : params . sessionId ,
19351936 host : machineName ,
1936- os : `${ os . type ( ) } ${ os . release ( ) } ` ,
1937+ os : `${ os . type ( ) } ${ resolveOsSummary ( ) . release } ` ,
19371938 arch : os . arch ( ) ,
19381939 node : process . version ,
19391940 model : `${ params . provider } /${ params . modelId } ` ,
Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ describe("resolveOsSummary", () => {
3737 expected : {
3838 platform : "darwin" ,
3939 arch : "arm64" ,
40- release : "24.0.0" ,
40+ // On darwin, release uses sw_vers -productVersion, not os.release()
41+ // (kernel 24.0.0 → macOS 15.4). #95145
42+ release : "15.4" ,
4143 label : "macos 15.4 (arm64)" ,
4244 } ,
4345 } ,
Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ function macosVersion(): string {
2121/** Resolves a compact OS label for diagnostics, logs, and environment summaries. */
2222export function resolveOsSummary ( ) : OsSummary {
2323 const platform = os . platform ( ) ;
24- const release = platform === "darwin" ? macosVersion ( ) : os . release ( ) ;
24+ // On darwin, os.release() returns the Darwin kernel version (e.g. "25.5.0"),
25+ // not the macOS product version ("26.5.1"). Use macosVersion() which calls
26+ // sw_vers -productVersion to get the actual macOS version. (#95145)
27+ const darwinProductVersion = platform === "darwin" ? macosVersion ( ) : null ;
28+ const release = darwinProductVersion ?? os . release ( ) ;
2529 const arch = os . arch ( ) ;
2630 const cacheKey = `${ platform } \0${ release } \0${ arch } ` ;
2731 // Cache by stable os.* facts; darwin's sw_vers lookup is comparatively slow
@@ -32,7 +36,7 @@ export function resolveOsSummary(): OsSummary {
3236 }
3337 const label = ( ( ) => {
3438 if ( platform === "darwin" ) {
35- return `macos ${ macosVersion ( ) } (${ arch } )` ;
39+ return `macos ${ darwinProductVersion } (${ arch } )` ;
3640 }
3741 if ( platform === "win32" ) {
3842 return `windows ${ release } (${ arch } )` ;
You can’t perform that action at this time.
0 commit comments