Fix session persistence and auto-start container system

- Fix session mount path: ~/.claude/ now mounts to /home/node/.claude/
  (container runs as 'node' user with HOME=/home/node, not root)
- Fix ~/.gmail-mcp/ mount path similarly
- Use absolute paths for GROUPS_DIR and DATA_DIR (required for container mounts)
- Auto-start Apple Container system on NanoClaw startup
- Update debug skill with session troubleshooting guide
- Update spec.md with startup sequence and troubleshooting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gavriel
2026-02-01 11:31:52 +02:00
parent 67e0295d82
commit 8ca4c95517
7 changed files with 130 additions and 21 deletions

View File

@@ -5,7 +5,7 @@ import makeWASocket, {
WASocket
} from '@whiskeysockets/baileys';
import pino from 'pino';
import { exec } from 'child_process';
import { exec, execSync } from 'child_process';
import fs from 'fs';
import path from 'path';
@@ -376,7 +376,25 @@ async function startMessageLoop(): Promise<void> {
}
}
function ensureContainerSystemRunning(): void {
try {
// Check if container system is already running
execSync('container system status', { stdio: 'pipe' });
logger.debug('Apple Container system already running');
} catch {
// Not running, try to start it
logger.info('Starting Apple Container system...');
try {
execSync('container system start', { stdio: 'pipe', timeout: 30000 });
logger.info('Apple Container system started');
} catch (err) {
logger.error({ err }, 'Failed to start Apple Container system - agents will not work');
}
}
}
async function main(): Promise<void> {
ensureContainerSystemRunning();
initDatabase();
logger.info('Database initialized');
loadState();