MAESTRO: Address PR review feedback — fix connection lifecycle, lazy channel access, buffer safety
- Move sseAbortController/connectionState from module globals into closure for multi-instance safety - Make start() idempotent by aborting existing connection before creating a new one - Track connectionPromise and await it on stop() for proper cleanup - Guard channel API access lazily to prevent crash when integrations are missing - Add 1MB MAX_SSE_BUFFER_SIZE to prevent unbounded buffer growth - Log malformed JSON parse errors instead of silently ignoring - Replace error: any with proper instanceof Error type narrowing - Remove hardcoded user paths from TESTING.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -28,7 +28,7 @@ curl -s -N http://localhost:37777/stream --max-time 3 2>/dev/null || true
|
||||
**If the worker is not running:**
|
||||
|
||||
```bash
|
||||
cd /Users/alexnewman/Scripts/claude-mem
|
||||
cd /path/to/claude-mem
|
||||
npm run build-and-sync
|
||||
```
|
||||
|
||||
@@ -50,7 +50,7 @@ cat ~/.openclaw/openclaw.json
|
||||
{
|
||||
"claude-mem": {
|
||||
"enabled": true,
|
||||
"source": "/Users/alexnewman/Scripts/claude-mem/openclaw",
|
||||
"source": "/path/to/claude-mem/openclaw",
|
||||
"config": {
|
||||
"syncMemoryFile": true,
|
||||
"workerPort": 37777,
|
||||
@@ -135,7 +135,7 @@ node test-sse-consumer.js
|
||||
|
||||
### Worker not running
|
||||
- **Symptom:** Gateway logs show `SSE stream error: fetch failed. Reconnecting in 1s`
|
||||
- **Fix:** Start the worker with `cd /Users/alexnewman/Scripts/claude-mem && npm run build-and-sync`
|
||||
- **Fix:** Start the worker with `cd /path/to/claude-mem && npm run build-and-sync`
|
||||
|
||||
### Port mismatch
|
||||
- **Symptom:** SSE connection fails even though worker health check passes
|
||||
|
||||
Reference in New Issue
Block a user