LearnNewsExamplesServices
Frontmatter
id7999
titleFix ReferenceError in Memory Core SessionService when GEMINI_API_KEY is missing
stateClosed
labels
bugai
assigneestobiu
createdAtDec 2, 2025, 8:49 PM
updatedAtDec 2, 2025, 8:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/7999
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 2, 2025, 8:56 PM

Fix ReferenceError in Memory Core SessionService when GEMINI_API_KEY is missing

Closed v11.16.0 bugai
tobiu
tobiu commented on Dec 2, 2025, 8:49 PM

Starting the memory core server without a GEMINI_API_KEY causes a ReferenceError: Cannot access 'HealthService' before initialization.

This is caused by a circular dependency between SessionService.mjs and HealthService.mjs. HealthService imports SessionService, and SessionService imports HealthService. When SessionService is initialized (triggered by HealthService import), it attempts to call HealthService.recordStartupSummarization in its construct method if the API key is missing. Since HealthService is still initializing, this throws.

Proposed Fix: Remove the static import of SessionService in HealthService.mjs and access SessionService lazily inside #performHealthCheck.

tobiu added the bug label on Dec 2, 2025, 8:49 PM
tobiu added the ai label on Dec 2, 2025, 8:49 PM
tobiu assigned to @tobiu on Dec 2, 2025, 8:50 PM
tobiu referenced in commit 9839409 - "Fix ReferenceError in Memory Core SessionService when GEMINI_API_KEY is missing #7999" on Dec 2, 2025, 8:56 PM
tobiu closed this issue on Dec 2, 2025, 8:56 PM