File tree Expand file tree Collapse file tree
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 { resolveRuntimeOsLabel } 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 : resolveRuntimeOsLabel ( ) ,
161162 arch : os . arch ( ) ,
162163 node : process . version ,
163164 model : params . modelDisplay ,
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import {
2424} from "../../infra/diagnostic-trace-context.js" ;
2525import { formatErrorMessage } from "../../infra/errors.js" ;
2626import { getMachineDisplayName } from "../../infra/machine-name.js" ;
27+ import { resolveRuntimeOsLabel } from "../../infra/os-summary.js" ;
2728import { generateSecureToken } from "../../infra/secure-random.js" ;
2829import { listRegisteredPluginAgentPromptGuidance } from "../../plugins/command-registry-state.js" ;
2930import { getCurrentPluginMetadataSnapshot } from "../../plugins/current-plugin-metadata-snapshot.js" ;
@@ -1035,7 +1036,7 @@ async function compactEmbeddedAgentSessionDirectOnce(
10351036
10361037 const runtimeInfo = {
10371038 host : machineName ,
1038- os : ` ${ os . type ( ) } ${ os . release ( ) } ` ,
1039+ os : resolveRuntimeOsLabel ( ) ,
10391040 arch : os . arch ( ) ,
10401041 node : process . version ,
10411042 model : `${ provider } /${ modelId } ` ,
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 { resolveRuntimeOsLabel } 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 : resolveRuntimeOsLabel ( ) ,
19371938 arch : os . arch ( ) ,
19381939 node : process . version ,
19391940 model : `${ params . provider } /${ params . modelId } ` ,
Original file line number Diff line number Diff line change @@ -18,6 +18,23 @@ function macosVersion(): string {
1818 return out || os . release ( ) ;
1919}
2020
21+ /**
22+ * Resolves the OS label for runtime-prompt context (e.g., "macOS 26.5.1" on Darwin,
23+ * "Linux 6.8.0" on other platforms).
24+ *
25+ * On Darwin this uses `sw_vers -productVersion` instead of `os.release()` which
26+ * returns the Darwin kernel version (e.g., 25.5.0) that no longer maps to the
27+ * macOS marketing version starting with macOS 26 (Tahoe).
28+ *
29+ * Fixes #95145
30+ */
31+ export function resolveRuntimeOsLabel ( ) : string {
32+ if ( os . platform ( ) === "darwin" ) {
33+ return `macOS ${ macosVersion ( ) } ` ;
34+ }
35+ return `${ os . type ( ) } ${ os . release ( ) } ` ;
36+ }
37+
2138/** Resolves a compact OS label for diagnostics, logs, and environment summaries. */
2239export function resolveOsSummary ( ) : OsSummary {
2340 const platform = os . platform ( ) ;
You can’t perform that action at this time.
0 commit comments