mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:01:25 +00:00
auto-reply: enrich chat status
This commit is contained in:
@@ -22,6 +22,9 @@ import {
|
||||
type MsgContext,
|
||||
type TemplateContext,
|
||||
} from "./templating.js";
|
||||
import { buildStatusMessage } from "./status.js";
|
||||
import { resolveHeartbeatSeconds } from "../web/reconnect.js";
|
||||
import { getWebAuthAgeMs, webAuthExists } from "../web/session.js";
|
||||
import {
|
||||
normalizeThinkLevel,
|
||||
normalizeVerboseLevel,
|
||||
@@ -503,6 +506,30 @@ export async function getReplyFromConfig(
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
rawBodyNormalized === "/status" ||
|
||||
rawBodyNormalized === "status" ||
|
||||
rawBodyNormalized.startsWith("/status ")
|
||||
) {
|
||||
const webLinked = await webAuthExists();
|
||||
const webAuthAgeMs = getWebAuthAgeMs();
|
||||
const heartbeatSeconds = resolveHeartbeatSeconds(cfg, undefined);
|
||||
const statusText = buildStatusMessage({
|
||||
reply,
|
||||
sessionEntry,
|
||||
sessionKey,
|
||||
sessionScope,
|
||||
storePath,
|
||||
resolvedThink: resolvedThinkLevel,
|
||||
resolvedVerbose: resolvedVerboseLevel,
|
||||
webLinked,
|
||||
webAuthAgeMs,
|
||||
heartbeatSeconds,
|
||||
});
|
||||
cleanupTyping();
|
||||
return { text: statusText };
|
||||
}
|
||||
|
||||
const abortRequested =
|
||||
reply?.mode === "command" && isAbortTrigger(rawBodyNormalized);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user