OpenClaw Session Policy Constants (openclawSessionPolicy/constants.ts)

lobsterai · src/main/openclawSessionPolicy/constants.ts · typescript · MIT
infra, ai, tag:constants, tag:session, tag:policy

Defines retention policies, keep-alive durations, and maintenance rules for AI chat sessions. Reuse when managing session lifecycles.

// Source: https://github.com/netease-youdao/lobsterai | License: MIT | Copyright 2026 NetEase Youdao
// Provided via justclaw.it.com; keep this notice with the code.
export const OpenClawSessionKeepAlive = {
  OneDay: '1d',
  SevenDays: '7d',
  ThirtyDays: '30d',
  OneYear: '365d',
} as const;

export type OpenClawSessionKeepAlive =
  typeof OpenClawSessionKeepAlive[keyof typeof OpenClawSessionKeepAlive];

export const OPENCLAW_SESSION_POLICY_STORE_KEY = 'openclaw_session_policy';

export interface OpenClawSessionPolicyConfig {
  keepAlive: OpenClawSessionKeepAlive;
}

export const DEFAULT_OPENCLAW_SESSION_POLICY_CONFIG: OpenClawSessionPolicyConfig = {
  keepAlive: OpenClawSessionKeepAlive.ThirtyDays,
};

export const OPENCLAW_SESSION_MAINTENANCE = {
  pruneAfter: '365d',
  maxEntries: 10

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key