refactor: stop exporting legacy session transcript dirs

This commit is contained in:
Peter Steinberger
2026-05-08 17:43:06 +01:00
parent a3357ba13b
commit eb812639f7
11 changed files with 1 additions and 25 deletions

View File

@@ -15,7 +15,6 @@ export {
export {
getRuntimeConfig,
resolveDefaultAgentId,
resolveSessionTranscriptsDirForAgent,
resolveStateDir,
type OpenClawConfig,
} from "openclaw/plugin-sdk/memory-core-host-runtime-core";

View File

@@ -38,7 +38,6 @@ vi.mock("./cli.host.runtime.js", async () => {
normalizeExtraMemoryPaths: runtimeFiles.normalizeExtraMemoryPaths,
resolveCommandSecretRefsViaGateway,
resolveDefaultAgentId,
resolveSessionTranscriptsDirForAgent: runtimeCore.resolveSessionTranscriptsDirForAgent,
resolveStateDir: runtimeCore.resolveStateDir,
setVerbose: runtimeCli.setVerbose,
shortenHomeInString: runtimeCli.shortenHomeInString,

View File

@@ -16,7 +16,6 @@ export {
export { parseDurationMs } from "./host/openclaw-runtime-config.js";
export { loadConfig } from "./host/openclaw-runtime-config.js";
export { resolveStateDir } from "./host/openclaw-runtime-config.js";
export { resolveSessionTranscriptsDirForAgent } from "./host/openclaw-runtime-config.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,

View File

@@ -5,7 +5,6 @@ export {
normalizeResolvedSecretInputString,
parseDurationMs,
parseNonNegativeByteSize,
resolveSessionTranscriptsDirForAgent,
resolveStateDir,
} from "./openclaw-runtime.js";
export type {

View File

@@ -14,7 +14,6 @@ export {
onSessionTranscriptUpdate,
parseUsageCountedSessionIdFromFileName,
resolveSqliteSessionTranscriptScopeForPath,
resolveSessionTranscriptsDirForAgent,
stripInboundMetadata,
stripInternalRuntimeContext,
} from "./openclaw-runtime.js";

View File

@@ -53,7 +53,6 @@ export {
isUsageCountedSessionTranscriptFileName,
parseUsageCountedSessionIdFromFileName,
} from "../../../../src/config/sessions/artifacts.js";
export { resolveSessionTranscriptsDirForAgent } from "../../../../src/config/sessions/paths.js";
export {
listSqliteSessionTranscripts,
loadSqliteSessionTranscriptEvents,

View File

@@ -19,7 +19,6 @@ export {
loadConfig,
} from "./host/openclaw-runtime-config.js";
export { resolveStateDir } from "./host/openclaw-runtime-config.js";
export { resolveSessionTranscriptsDirForAgent } from "./host/openclaw-runtime-config.js";
export { emptyPluginConfigSchema } from "./host/openclaw-runtime-memory.js";
export {
buildActiveMemoryPromptSection,

View File

@@ -12,7 +12,7 @@ import {
resolveSessionKey,
updateLastRoute,
} from "./sessions.js";
import { resolveSessionFilePath, resolveSessionTranscriptsDir } from "./sessions/paths.js";
import { resolveSessionFilePath } from "./sessions/paths.js";
import {
deleteSessionEntry,
listSessionEntries,
@@ -599,14 +599,6 @@ describe("sessions", () => {
expect(entry.lastProvider).toBeUndefined();
});
it("derives session transcripts dir from OPENCLAW_STATE_DIR", () => {
const dir = resolveSessionTranscriptsDir(
{ OPENCLAW_STATE_DIR: "/custom/state" } as NodeJS.ProcessEnv,
() => "/home/ignored",
);
expect(dir).toBe(path.join(path.resolve("/custom/state"), "agents", "main", "sessions"));
});
it("uses agent id when resolving session file fallback paths", () => {
withStateDir("/custom/state", () => {
const sessionFile = resolveSessionFilePath("sess-2", undefined, {

View File

@@ -15,13 +15,6 @@ function resolveAgentSessionsDir(
return path.join(root, "agents", id, "sessions");
}
export function resolveSessionTranscriptsDir(
env: NodeJS.ProcessEnv = process.env,
homedir: () => string = () => resolveRequiredHomeDir(env, os.homedir),
): string {
return resolveAgentSessionsDir(DEFAULT_AGENT_ID, env, homedir);
}
export function resolveSessionTranscriptsDirForAgent(
agentId?: string,
env: NodeJS.ProcessEnv = process.env,

View File

@@ -16,7 +16,6 @@ export { parseDurationMs } from "../cli/parse-duration.js";
export { loadConfig } from "../config/config.js";
export type { OpenClawConfig } from "../config/config.js";
export { resolveStateDir } from "../config/paths.js";
export { resolveSessionTranscriptsDirForAgent } from "../config/sessions/paths.js";
export {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,

View File

@@ -18,7 +18,6 @@ export { parseNonNegativeByteSize } from "../config/byte-size.js";
export { getRuntimeConfig, loadConfig } from "../config/config.js";
export type { OpenClawConfig } from "../config/config.js";
export { resolveStateDir } from "../config/paths.js";
export { resolveSessionTranscriptsDirForAgent } from "../config/sessions/paths.js";
export {
appendSqliteSessionTranscriptEvent,
replaceSqliteSessionTranscriptEvents,