Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion examples/openclaw-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
resolvePythonCommand,
prepareLocalPort,
} from "./process-manager.js";
import { createMemoryOpenVikingContextEngine } from "./context-engine.js";
import { createMemoryOpenVikingContextEngine, mapSessionKeyToOVSessionId } from "./context-engine.js";
import type { ContextEngineWithSessionMapping } from "./context-engine.js";

type PluginLogger = {
Expand Down Expand Up @@ -263,6 +263,12 @@ const contextEnginePlugin = {
sessionId = await contextEngineRef.resolveOVSession(sessionKeyIn);
usedMappedSession = true;
}
if (!sessionId && sessionKeyIn) {
// Fallback: resolve directly without contextEngineRef (covers cases
// where registerContextEngine is unavailable or factory not yet called)
sessionId = mapSessionKeyToOVSessionId(sessionKeyIn);
usedMappedSession = true;
}
if (!sessionId) {
return {
content: [{ type: "text", text: "Either sessionKey or sessionId is required to store memory." }],
Expand Down