import type { SessionMaintenanceWarning } from "../config/sessions/store-maintenance.js"; import type { SessionEntry } from "../config/sessions/types.js"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { deliveryContextFromSession } from "../utils/delivery-context.shared.js"; import { isDeliverableMessageChannel, normalizeMessageChannel } from "../utils/message-channel.js"; import { buildOutboundSessionContext } from "./outbound/session-context.js"; import { enqueueSystemEvent } from "./system-events.js";
function buildWarningText(warning: SessionMaintenanceWarning): string { const reasons: string[] = []; if (warning.wouldPrune) {
reasons.push(`older than ${formatDuration(warning.pruneAfterMs)}`);
} if (warning.wouldCap) {
reasons.push(`not in the most recent ${warning.maxEntries} sessions`);
} const reasonText = reasons.length > 0 ? reasons.join(" and ") : "over maintenance limits"; return (
`⚠️ Session maintenance warning: this active session would be evicted (${reasonText}). ` +
`Maintenance is set to warn-only, so nothing was reset. ` +
`To enforce cleanup, set \`session.maintenance.mode: "enforce"\` or increase the limits.`
);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.