mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-14 08:04:17 +00:00
refactor: stop exporting legacy session transcript dirs
This commit is contained in:
@@ -15,7 +15,6 @@ export {
|
||||
export {
|
||||
getRuntimeConfig,
|
||||
resolveDefaultAgentId,
|
||||
resolveSessionTranscriptsDirForAgent,
|
||||
resolveStateDir,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/memory-core-host-runtime-core";
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -5,7 +5,6 @@ export {
|
||||
normalizeResolvedSecretInputString,
|
||||
parseDurationMs,
|
||||
parseNonNegativeByteSize,
|
||||
resolveSessionTranscriptsDirForAgent,
|
||||
resolveStateDir,
|
||||
} from "./openclaw-runtime.js";
|
||||
export type {
|
||||
|
||||
@@ -14,7 +14,6 @@ export {
|
||||
onSessionTranscriptUpdate,
|
||||
parseUsageCountedSessionIdFromFileName,
|
||||
resolveSqliteSessionTranscriptScopeForPath,
|
||||
resolveSessionTranscriptsDirForAgent,
|
||||
stripInboundMetadata,
|
||||
stripInternalRuntimeContext,
|
||||
} from "./openclaw-runtime.js";
|
||||
|
||||
@@ -53,7 +53,6 @@ export {
|
||||
isUsageCountedSessionTranscriptFileName,
|
||||
parseUsageCountedSessionIdFromFileName,
|
||||
} from "../../../../src/config/sessions/artifacts.js";
|
||||
export { resolveSessionTranscriptsDirForAgent } from "../../../../src/config/sessions/paths.js";
|
||||
export {
|
||||
listSqliteSessionTranscripts,
|
||||
loadSqliteSessionTranscriptEvents,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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, {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user