MCPcopy Create free account
hub / github.com/Noumena-Network/code / initSessionMemory

Function initSessionMemory

src/services/SessionMemory/sessionMemory.ts:358–376  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

356 * The gate check and config loading happen lazily when the hook runs.
357 */
358export function initSessionMemory(): void {
359 if (getIsRemoteMode()) return
360 // Session memory is used for compaction, so respect auto-compact settings
361 const autoCompactEnabled = isAutoCompactEnabled()
362
363 // Log initialization state (ant-only to avoid noise in external logs)
364 if (isInternalBuild()) {
365 logEvent('ncode_session_memory_init', {
366 auto_compact_enabled: autoCompactEnabled,
367 })
368 }
369
370 if (!autoCompactEnabled) {
371 return
372 }
373
374 // Register hook unconditionally - gate check happens lazily when hook runs
375 registerPostSamplingHook(extractSessionMemory)
376}
377
378export type ManualExtractionResult = {
379 success: boolean

Callers 1

setupFunction · 0.85

Calls 5

getIsRemoteModeFunction · 0.85
isAutoCompactEnabledFunction · 0.85
isInternalBuildFunction · 0.85
registerPostSamplingHookFunction · 0.85
logEventFunction · 0.50

Tested by

no test coverage detected