mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 19:35:28 -06:00
clawdbot-d02: route plugin timestamp reads through accessor
This commit is contained in:
@@ -3,11 +3,27 @@
|
||||
*/
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
listSessionEntries as listAccessorSessionEntries,
|
||||
loadSessionEntry,
|
||||
readSessionUpdatedAt as readAccessorSessionUpdatedAt,
|
||||
} from "../config/sessions/session-accessor.js";
|
||||
import {
|
||||
getSessionEntry,
|
||||
listSessionEntries,
|
||||
readSessionUpdatedAt,
|
||||
resolveLivePluginConfigObject,
|
||||
resolvePluginConfigObject,
|
||||
type OpenClawConfig,
|
||||
} from "./config-runtime.js";
|
||||
|
||||
describe("config-runtime session read exports", () => {
|
||||
it("routes read helpers through the session accessor seam", () => {
|
||||
expect(getSessionEntry).toBe(loadSessionEntry);
|
||||
expect(listSessionEntries).toBe(listAccessorSessionEntries);
|
||||
expect(readSessionUpdatedAt).toBe(readAccessorSessionUpdatedAt);
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolvePluginConfigObject", () => {
|
||||
it("returns the plugin config object for a configured plugin entry", () => {
|
||||
const config = {
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
* config-mutation, and runtime-config-snapshot.
|
||||
*/
|
||||
|
||||
import {
|
||||
listSessionEntries,
|
||||
loadSessionEntry as getSessionEntry,
|
||||
readSessionUpdatedAt,
|
||||
} from "../config/sessions/session-accessor.js";
|
||||
import { loadSessionStore as loadSessionStoreImpl } from "../config/sessions/store-load.js";
|
||||
|
||||
/**
|
||||
@@ -12,6 +17,7 @@ import { loadSessionStore as loadSessionStoreImpl } from "../config/sessions/sto
|
||||
* legacy mutable whole-store shape and will remain a compatibility escape hatch.
|
||||
*/
|
||||
export const loadSessionStore = loadSessionStoreImpl;
|
||||
export { getSessionEntry, listSessionEntries, readSessionUpdatedAt };
|
||||
|
||||
export { resolveDefaultAgentId } from "../agents/agent-scope.js";
|
||||
export {
|
||||
@@ -141,10 +147,7 @@ export type {
|
||||
} from "../config/types.js";
|
||||
export {
|
||||
clearSessionStoreCacheForTest,
|
||||
getSessionEntry,
|
||||
listSessionEntries,
|
||||
patchSessionEntry,
|
||||
readSessionUpdatedAt,
|
||||
recordSessionMetaFromInbound,
|
||||
saveSessionStore,
|
||||
updateLastRoute,
|
||||
|
||||
@@ -2,12 +2,18 @@ import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
listSessionEntries as listAccessorSessionEntries,
|
||||
loadSessionEntry,
|
||||
readSessionUpdatedAt as readAccessorSessionUpdatedAt,
|
||||
} from "../config/sessions/session-accessor.js";
|
||||
import { getSessionEntry, listSessionEntries } from "./session-store-runtime.js";
|
||||
import {
|
||||
getSessionEntry,
|
||||
listSessionEntries,
|
||||
readSessionUpdatedAt,
|
||||
} from "./session-store-runtime.js";
|
||||
|
||||
describe("session-store-runtime", () => {
|
||||
it("routes read helpers through the session accessor seam", () => {
|
||||
expect(getSessionEntry).toBe(loadSessionEntry);
|
||||
expect(listSessionEntries).toBe(listAccessorSessionEntries);
|
||||
expect(readSessionUpdatedAt).toBe(readAccessorSessionUpdatedAt);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import {
|
||||
listSessionEntries,
|
||||
loadSessionEntry as getSessionEntry,
|
||||
readSessionUpdatedAt,
|
||||
} from "../config/sessions/session-accessor.js";
|
||||
import { loadSessionStore as loadSessionStoreImpl } from "../config/sessions/store-load.js";
|
||||
|
||||
@@ -12,7 +13,7 @@ import { loadSessionStore as loadSessionStoreImpl } from "../config/sessions/sto
|
||||
* legacy mutable whole-store shape and will remain a compatibility escape hatch.
|
||||
*/
|
||||
export const loadSessionStore = loadSessionStoreImpl;
|
||||
export { getSessionEntry, listSessionEntries };
|
||||
export { getSessionEntry, listSessionEntries, readSessionUpdatedAt };
|
||||
|
||||
export { resolveSessionStoreEntry } from "../config/sessions/store-entry.js";
|
||||
export {
|
||||
@@ -28,7 +29,6 @@ export { canonicalizeMainSessionAlias } from "../config/sessions/main-session.js
|
||||
export {
|
||||
clearSessionStoreCacheForTest,
|
||||
patchSessionEntry,
|
||||
readSessionUpdatedAt,
|
||||
recordSessionMetaFromInbound,
|
||||
saveSessionStore,
|
||||
updateLastRoute,
|
||||
|
||||
@@ -64,11 +64,11 @@ import {
|
||||
} from "../../config/group-policy.js";
|
||||
import { resolveMarkdownTableMode } from "../../config/markdown-tables.js";
|
||||
import {
|
||||
readSessionUpdatedAt,
|
||||
recordSessionMetaFromInbound,
|
||||
resolveStorePath,
|
||||
updateLastRoute,
|
||||
} from "../../config/sessions.js";
|
||||
import { readSessionUpdatedAt } from "../../config/sessions/session-accessor.js";
|
||||
import { getChannelActivity, recordChannelActivity } from "../../infra/channel-activity.js";
|
||||
import {
|
||||
fetchRemoteMedia,
|
||||
|
||||
Reference in New Issue
Block a user