mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 21:40:21 +00:00
feat(context-engine): plumb sessionKey into all ContextEngine methods (#44157)
Merged via squash.
Prepared head SHA: 0b341f6f4c
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
export function resolveGlobalSingleton<T>(key: symbol, create: () => T): T {
|
||||
const globalStore = globalThis as Record<PropertyKey, unknown>;
|
||||
const existing = globalStore[key] as T | undefined;
|
||||
if (Object.prototype.hasOwnProperty.call(globalStore, key)) {
|
||||
return existing;
|
||||
return globalStore[key] as T;
|
||||
}
|
||||
const created = create();
|
||||
globalStore[key] = created;
|
||||
|
||||
Reference in New Issue
Block a user