specmem-hardwicksoftware 3.7.15 → 3.7.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -155,8 +155,9 @@ function syncConfigJson() {
155
155
  needsFix = true;
156
156
  }
157
157
  // Check args - should point to bootstrap.cjs
158
- const expectedArgs = ['--max-old-space-size=250', BOOTSTRAP_PATH];
159
- const actualEntryPoint = existing.args?.[1];
158
+ const expectedArgs = [BOOTSTRAP_PATH];
159
+ // Support both old format (with --max-old-space-size) and new format (just path)
160
+ const actualEntryPoint = existing.args?.find(a => a.includes('bootstrap.cjs') || a.includes('mcp-proxy.cjs'));
160
161
  if (actualEntryPoint !== BOOTSTRAP_PATH) {
161
162
  mismatches.push({
162
163
  file: 'config.json',
@@ -185,7 +186,7 @@ function syncConfigJson() {
185
186
  // Fix config.json
186
187
  config.mcpServers['specmem'] = {
187
188
  command: 'node',
188
- args: ['--max-old-space-size=250', BOOTSTRAP_PATH],
189
+ args: [BOOTSTRAP_PATH],
189
190
  env: {
190
191
  HOME: os.homedir(),
191
192
  // Project-local configuration - ${cwd} is expanded by Code per-invocation
@@ -242,7 +242,7 @@ function configureMcpServer() {
242
242
  // CRITICAL: ${PWD} is expanded at MCP server startup to current working directory
243
243
  const specmemConfig = {
244
244
  command: 'node',
245
- args: ['--max-old-space-size=250', BOOTSTRAP_PATH],
245
+ args: [BOOTSTRAP_PATH],
246
246
  env: {
247
247
  // Core paths - ${PWD} gives us project isolation (dynamic per-directory)
248
248
  HOME: HOME_DIR,
@@ -348,7 +348,7 @@ function fixProjectMcpConfigs() {
348
348
  // Don't clobber other MCP servers - only add specmem
349
349
  config.mcpServers.specmem = {
350
350
  command: 'node',
351
- args: ['--max-old-space-size=250', BOOTSTRAP_PATH],
351
+ args: [BOOTSTRAP_PATH],
352
352
  env: {
353
353
  HOME: HOME_DIR,
354
354
  SPECMEM_PROJECT_PATH: '${PWD}',
package/mcp-proxy.cjs CHANGED
@@ -106,8 +106,20 @@ function sendToClient(msg) {
106
106
  // Send message to MCP server (child stdin)
107
107
  // ============================================================================
108
108
  function sendToServer(msg) {
109
- if (!child || !childReady || child.killed) {
110
- // Queue it
109
+ // CRITICAL: Always forward initialize and notifications/initialized immediately
110
+ // even before childReady — these are what MAKE the child ready.
111
+ // Without this, deadlock: proxy waits for init response, bootstrap waits for init request.
112
+ const isInitFlow = msg.method === 'initialize' || msg.method === 'notifications/initialized';
113
+
114
+ if (!child || child.killed) {
115
+ if (pendingQueue.length < MAX_QUEUE_SIZE) {
116
+ pendingQueue.push(msg);
117
+ log(`Queued message (no child) (${pendingQueue.length} pending): ${msg.method || msg.id || '?'}`);
118
+ }
119
+ return;
120
+ }
121
+
122
+ if (!childReady && !isInitFlow) {
111
123
  if (pendingQueue.length < MAX_QUEUE_SIZE) {
112
124
  pendingQueue.push(msg);
113
125
  log(`Queued message (${pendingQueue.length} pending): ${msg.method || msg.id || '?'}`);
@@ -155,7 +167,11 @@ function spawnServer() {
155
167
 
156
168
  log(`Spawning server: node ${BOOTSTRAP_PATH} ${args.join(' ')}`);
157
169
 
158
- child = spawn('node', ['--max-old-space-size=250', BOOTSTRAP_PATH, ...args], {
170
+ // CRITICAL: Do NOT hardcode --max-old-space-size here
171
+ // The proxy's own heap limit is set by Claude config args (e.g. --max-old-space-size=250)
172
+ // but the child bootstrap needs MORE memory for all its initialization
173
+ const heapLimit = process.env.SPECMEM_MAX_HEAP_MB || '512';
174
+ child = spawn('node', [`--max-old-space-size=${heapLimit}`, BOOTSTRAP_PATH, ...args], {
159
175
  env,
160
176
  stdio: ['pipe', 'pipe', 'pipe'],
161
177
  cwd: process.env.SPECMEM_PROJECT_PATH || process.cwd()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specmem-hardwicksoftware",
3
- "version": "3.7.15",
3
+ "version": "3.7.17",
4
4
  "type": "module",
5
5
  "description": "Persistent memory system for coding sessions - semantic search with pgvector, token compression, team coordination, file watching. Needs root: installs system-wide hooks, manages docker/PostgreSQL, writes global configs, handles screen sessions. justcalljon.pro",
6
6
  "main": "dist/index.js",
@@ -6519,7 +6519,6 @@ async function runAutoSetup(projectPath) {
6519
6519
  type: "stdio",
6520
6520
  command: "node",
6521
6521
  args: [
6522
- "--max-old-space-size=250",
6523
6522
  mcpEntry
6524
6523
  ],
6525
6524
  env: {
@@ -6531,7 +6530,8 @@ async function runAutoSetup(projectPath) {
6531
6530
  SPECMEM_DB_PORT: "5432",
6532
6531
  SPECMEM_DB_NAME: "specmem_westayunprofessional",
6533
6532
  SPECMEM_DB_USER: "specmem_westayunprofessional",
6534
- SPECMEM_DB_PASSWORD: "specmem_westayunprofessional"
6533
+ SPECMEM_DB_PASSWORD: "specmem_westayunprofessional",
6534
+ SPECMEM_MAX_HEAP_MB: "512"
6535
6535
  }
6536
6536
  };
6537
6537
  claudeJson.projects[projectPath].hasTrustDialogAccepted = true;