mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:08:26 +00:00
refactor: centralize presence routing and version precedence coverage (#19609)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 10d9df5263
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
committed by
GitHub
parent
5c69e625f5
commit
07fdceb5fd
@@ -1,6 +1,7 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import os from "node:os";
|
||||
import { pickPrimaryLanIPv4 } from "../gateway/net.js";
|
||||
import { resolveRuntimeServiceVersion } from "../version.js";
|
||||
|
||||
export type SystemPresence = {
|
||||
host?: string;
|
||||
@@ -50,11 +51,7 @@ function resolvePrimaryIPv4(): string | undefined {
|
||||
function initSelfPresence() {
|
||||
const host = os.hostname();
|
||||
const ip = resolvePrimaryIPv4() ?? undefined;
|
||||
const version =
|
||||
process.env.OPENCLAW_VERSION ??
|
||||
process.env.OPENCLAW_SERVICE_VERSION ??
|
||||
process.env.npm_package_version ??
|
||||
"unknown";
|
||||
const version = resolveRuntimeServiceVersion(process.env, "unknown");
|
||||
const modelIdentifier = (() => {
|
||||
const p = os.platform();
|
||||
if (p === "darwin") {
|
||||
|
||||
Reference in New Issue
Block a user