mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:31:25 +00:00
feat: show memory summary in status
This commit is contained in:
@@ -64,6 +64,7 @@ export async function statusCommand(
|
||||
agentStatus,
|
||||
channels,
|
||||
summary,
|
||||
memory,
|
||||
} = scan;
|
||||
|
||||
const securityAudit = await withProgress(
|
||||
@@ -114,6 +115,7 @@ export async function statusCommand(
|
||||
...summary,
|
||||
os: osSummary,
|
||||
update,
|
||||
memory,
|
||||
gateway: {
|
||||
mode: gatewayMode,
|
||||
url: gatewayConnection.url,
|
||||
@@ -232,6 +234,43 @@ export async function statusCommand(
|
||||
? `${summary.sessions.paths.length} stores`
|
||||
: (summary.sessions.paths[0] ?? "unknown");
|
||||
|
||||
const memoryValue = (() => {
|
||||
if (!memory) return muted("disabled");
|
||||
const parts: string[] = [];
|
||||
const dirtySuffix = memory.dirty ? ` · ${warn("dirty")}` : "";
|
||||
parts.push(`${memory.files} files · ${memory.chunks} chunks${dirtySuffix}`);
|
||||
if (memory.sources?.length) parts.push(`sources ${memory.sources.join(", ")}`);
|
||||
const vector = memory.vector;
|
||||
parts.push(
|
||||
vector?.enabled === false
|
||||
? muted("vector off")
|
||||
: vector?.available
|
||||
? ok("vector ready")
|
||||
: vector?.available === false
|
||||
? warn("vector unavailable")
|
||||
: muted("vector unknown"),
|
||||
);
|
||||
const fts = memory.fts;
|
||||
if (fts) {
|
||||
parts.push(
|
||||
fts.enabled === false
|
||||
? muted("fts off")
|
||||
: fts.available
|
||||
? ok("fts ready")
|
||||
: warn("fts unavailable"),
|
||||
);
|
||||
}
|
||||
const cache = memory.cache;
|
||||
if (cache) {
|
||||
parts.push(
|
||||
cache.enabled
|
||||
? ok(`cache on${typeof cache.entries === "number" ? ` (${cache.entries})` : ""}`)
|
||||
: muted("cache off"),
|
||||
);
|
||||
}
|
||||
return parts.join(" · ");
|
||||
})();
|
||||
|
||||
const updateAvailability = resolveUpdateAvailability(update);
|
||||
const updateLine = formatUpdateOneLiner(update).replace(/^Update:\s*/i, "");
|
||||
|
||||
@@ -254,6 +293,7 @@ export async function statusCommand(
|
||||
{ Item: "Gateway", Value: gatewayValue },
|
||||
{ Item: "Daemon", Value: daemonValue },
|
||||
{ Item: "Agents", Value: agentsValue },
|
||||
{ Item: "Memory", Value: memoryValue },
|
||||
{ Item: "Probes", Value: probesValue },
|
||||
{ Item: "Events", Value: eventsValue },
|
||||
{ Item: "Heartbeat", Value: heartbeatValue },
|
||||
|
||||
Reference in New Issue
Block a user