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

推荐订阅源

小众软件
小众软件
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
J
Java Code Geeks
A
About on SuperTechFans
F
Fortinet All Blogs
B
Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园_首页
博客园 - 叶小钗
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
云风的 BLOG
云风的 BLOG

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
refactor: add session reset delete lifecycle seam (#93659...
jalehman · 2026-06-18 · via Recent Commits to openclaw:main

@@ -23,21 +23,28 @@ import type { ResolvedSessionMaintenanceConfig } from "./store-maintenance.js";

2323

import {

2424

getSessionEntry,

2525

cleanupSessionLifecycleArtifacts as cleanupFileSessionLifecycleArtifacts,

26+

deleteSessionEntryLifecycle as deleteFileSessionEntryLifecycle,

2627

listSessionEntries as listFileSessionEntries,

2728

loadSessionStore,

2829

applySessionEntryPatchProjection as applyFileSessionEntryPatchProjection,

2930

patchSessionEntry as patchFileSessionEntry,

3031

readSessionUpdatedAt as readFileSessionUpdatedAt,

3132

resolveSessionStoreEntry,

33+

resetSessionEntryLifecycle as resetFileSessionEntryLifecycle,

3234

updateSessionStore,

3335

updateSessionStoreEntry as updateFileSessionStoreEntry,

36+

type DeleteSessionEntryLifecycleResult,

37+

type ResetSessionEntryLifecycleMutation,

38+

type ResetSessionEntryLifecycleResult,

3439

type SessionEntryPatchProjectionContext,

3540

type SessionEntryPatchProjectionFailure,

3641

type SessionEntryPatchProjectionResult,

3742

type SessionEntryPatchProjectionSnapshot,

3843

type SessionEntryPatchProjectionTarget,

44+

type SessionLifecycleArchivedTranscript,

3945

type SessionLifecycleArtifactCleanupParams,

4046

type SessionLifecycleArtifactCleanupResult,

47+

type SessionLifecycleStoreTarget,

4148

} from "./store.js";

4249

import { parseSessionThreadInfo } from "./thread-info.js";

4350

import {

@@ -280,7 +287,41 @@ export type SessionPatchProjectionResult<TFailure extends SessionPatchProjection

280287

export type SessionPatchProjectionSnapshot = SessionEntryPatchProjectionSnapshot;

281288

export type SessionPatchProjectionTarget = SessionEntryPatchProjectionTarget;

282289283-

export type { SessionLifecycleArtifactCleanupParams, SessionLifecycleArtifactCleanupResult };

290+

export type {

291+

DeleteSessionEntryLifecycleResult,

292+

ResetSessionEntryLifecycleResult,

293+

SessionLifecycleArchivedTranscript,

294+

SessionLifecycleArtifactCleanupParams,

295+

SessionLifecycleArtifactCleanupResult,

296+

SessionLifecycleStoreTarget,

297+

};

298+299+

export type ResetSessionEntryLifecycleParams = {

300+

/** Runs after the persisted entry rotates and before transcript artifacts move. */

301+

afterEntryMutation?: (mutation: ResetSessionEntryLifecycleMutation) => Promise<void> | void;

302+

/** Agent owner used to resolve backend transcript artifacts. */

303+

agentId?: string;

304+

/** Builds the persisted replacement entry from the current backend row. */

305+

buildNextEntry: (context: {

306+

currentEntry?: SessionEntry;

307+

primaryKey: string;

308+

}) => Promise<SessionEntry> | SessionEntry;

309+

/** Explicit store target for file-backed stores and SQLite migration adapters. */

310+

storePath: string;

311+

/** Canonical key plus aliases that identify the logical entry. */

312+

target: SessionLifecycleStoreTarget;

313+

};

314+315+

export type DeleteSessionEntryLifecycleParams = {

316+

/** Agent owner used to resolve backend transcript artifacts. */

317+

agentId?: string;

318+

/** Whether transcript artifacts should be archived/deleted with the entry. */

319+

archiveTranscript: boolean;

320+

/** Explicit store target for file-backed stores and SQLite migration adapters. */

321+

storePath: string;

322+

/** Canonical key plus aliases that identify the logical entry. */

323+

target: SessionLifecycleStoreTarget;

324+

};

284325285326

/** Returns the entry for a canonical or alias session key, if one exists. */

286327

export function loadSessionEntry(scope: SessionAccessScope): SessionEntry | undefined {

@@ -521,6 +562,20 @@ export async function cleanupSessionLifecycleArtifacts(

521562

return await cleanupFileSessionLifecycleArtifacts(params);

522563

}

523564565+

/** Resets one persisted session entry and transitions its transcript state. */

566+

export async function resetSessionEntryLifecycle(

567+

params: ResetSessionEntryLifecycleParams,

568+

): Promise<ResetSessionEntryLifecycleResult> {

569+

return await resetFileSessionEntryLifecycle(params);

570+

}

571+572+

/** Deletes one persisted session entry and transitions its transcript state. */

573+

export async function deleteSessionEntryLifecycle(

574+

params: DeleteSessionEntryLifecycleParams,

575+

): Promise<DeleteSessionEntryLifecycleResult> {

576+

return await deleteFileSessionEntryLifecycle(params);

577+

}

578+524579

/** Reads parsed transcript records from an explicit or derived transcript target. */

525580

export async function loadTranscriptEvents(

526581

scope: SessionTranscriptReadScope,