Frontmatter
| id | 7999 |
| title | Fix ReferenceError in Memory Core SessionService when GEMINI_API_KEY is missing |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Dec 2, 2025, 8:49 PM |
| updatedAt | Dec 2, 2025, 8:56 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7999 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 2, 2025, 8:56 PM |
Starting the memory core server without a
GEMINI_API_KEYcauses aReferenceError: Cannot access 'HealthService' before initialization.This is caused by a circular dependency between
SessionService.mjsandHealthService.mjs.HealthServiceimportsSessionService, andSessionServiceimportsHealthService. WhenSessionServiceis initialized (triggered byHealthServiceimport), it attempts to callHealthService.recordStartupSummarizationin itsconstructmethod if the API key is missing. SinceHealthServiceis still initializing, this throws.Proposed Fix: Remove the static import of
SessionServiceinHealthService.mjsand accessSessionServicelazily inside#performHealthCheck.