惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
小众软件
小众软件
美团技术团队
Martin Fowler
Martin Fowler
爱范儿
爱范儿
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
J
Java Code Geeks
B
Blog
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
博客园 - Franky

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
docs: document session cleanup helpers · openclaw/opencla...
steipete · 2026-06-05 · via Recent Commits to openclaw:main

@@ -1,3 +1,6 @@

1+

// Session artifact filename classifiers and archive timestamp helpers.

2+

// Cleanup, disk-budget, and usage accounting use these predicates to avoid deleting live transcripts.

3+14

import { timestampMsToIsoFileStamp } from "@openclaw/normalization-core/number-coercion";

25

import { escapeRegExp } from "../../shared/regexp.js";

36

@@ -18,6 +21,7 @@ function hasArchiveSuffix(fileName: string, reason: SessionArchiveReason): boole

1821

return ARCHIVE_TIMESTAMP_RE.test(raw);

1922

}

202324+

/** Returns true for archived session artifacts and legacy store backup names. */

2125

export function isSessionArchiveArtifactName(fileName: string): boolean {

2226

if (LEGACY_STORE_BACKUP_RE.test(fileName)) {

2327

return true;

@@ -59,6 +63,7 @@ export function isSessionStoreTempArtifactName(fileName: string, storeBasename:

5963

return sessionStoreTempPattern(storeBasename).test(fileName);

6064

}

616566+

/** Parses a compaction checkpoint transcript filename into session/checkpoint ids. */

6267

export function parseCompactionCheckpointTranscriptFileName(fileName: string): {

6368

sessionId: string;

6469

checkpointId: string;

@@ -69,22 +74,27 @@ export function parseCompactionCheckpointTranscriptFileName(fileName: string): {

6974

return sessionId && checkpointId ? { sessionId, checkpointId } : null;

7075

}

717677+

/** Returns true when a filename is a compaction checkpoint transcript. */

7278

export function isCompactionCheckpointTranscriptFileName(fileName: string): boolean {

7379

return parseCompactionCheckpointTranscriptFileName(fileName) !== null;

7480

}

758182+

/** Returns true for trajectory runtime jsonl artifacts. */

7683

export function isTrajectoryRuntimeArtifactName(fileName: string): boolean {

7784

return fileName.endsWith(".trajectory.jsonl");

7885

}

798687+

/** Returns true for trajectory pointer artifacts. */

8088

export function isTrajectoryPointerArtifactName(fileName: string): boolean {

8189

return fileName.endsWith(".trajectory-path.json");

8290

}

839192+

/** Returns true for any trajectory-related session artifact. */

8493

export function isTrajectorySessionArtifactName(fileName: string): boolean {

8594

return isTrajectoryRuntimeArtifactName(fileName) || isTrajectoryPointerArtifactName(fileName);

8695

}

879697+

/** Returns true for primary session transcript files that represent live session history. */

8898

export function isPrimarySessionTranscriptFileName(fileName: string): boolean {

8999

if (fileName === "sessions.json") {

90100

return false;

@@ -101,13 +111,15 @@ export function isPrimarySessionTranscriptFileName(fileName: string): boolean {

101111

return !isSessionArchiveArtifactName(fileName);

102112

}

103113114+

/** Returns true for transcript files counted in usage, including reset/deleted archives. */

104115

export function isUsageCountedSessionTranscriptFileName(fileName: string): boolean {

105116

if (isPrimarySessionTranscriptFileName(fileName)) {

106117

return true;

107118

}

108119

return hasArchiveSuffix(fileName, "reset") || hasArchiveSuffix(fileName, "deleted");

109120

}

110121122+

/** Extracts the session id from a usage-counted transcript filename. */

111123

export function parseUsageCountedSessionIdFromFileName(fileName: string): string | null {

112124

if (isPrimarySessionTranscriptFileName(fileName)) {

113125

return fileName.slice(0, -".jsonl".length);

@@ -122,6 +134,7 @@ export function parseUsageCountedSessionIdFromFileName(fileName: string): string

122134

return null;

123135

}

124136137+

/** Formats an archive timestamp that is safe for filenames. */

125138

export function formatSessionArchiveTimestamp(nowMs = Date.now()): string {

126139

return timestampMsToIsoFileStamp(nowMs);

127140

}