Skip to content

fix(openclaw-plugin): resolve sessionKey in memory_store without contextEngineRef#1039

Open
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/memory-store-sessionkey-fallback
Open

fix(openclaw-plugin): resolve sessionKey in memory_store without contextEngineRef#1039
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/memory-store-sessionkey-fallback

Conversation

@mobilebarn
Copy link
Copy Markdown

Summary

  • memory_store tool throws "Either sessionKey or sessionId is required" even when sessionKey is passed, because the session mapping depends on contextEngineRef being non-null
  • contextEngineRef is null when registerContextEngine is unavailable on the OpenClaw API or when the factory hasn't been called yet
  • Adds a direct fallback to mapSessionKeyToOVSessionId() so session mapping works regardless of context engine state

Test plan

  • Call memory_store with sessionKey on an OpenClaw version that does not expose registerContextEngine — should succeed instead of rejecting
  • Call memory_store with sessionKey immediately after plugin load (before context engine factory is invoked) — should succeed
  • Existing memory_store with sessionId path unchanged
  • TypeScript check and vitest pass

…extEngineRef

memory_store failed with "Either sessionKey or sessionId is required"
when sessionKey was passed but contextEngineRef was null (either because
registerContextEngine was unavailable or the factory hadn't been called
yet). Fall back to mapSessionKeyToOVSessionId directly so session
mapping works regardless of context engine state.
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant