fix: make MongoDB mandatory, fail loud instead of degrading
Reverse the best-effort error swallowing. MongoDB is core to PodMan's continual-learning story and must always be used, so a broken memory layer must surface immediately rather than silently masquerade as working (which is how observations stayed at 0 unnoticed). - agent verifies Mongo via initMemory() at boot; bad creds / unreachable Atlas now fail loudly before joining the room, not mid-demo - server exits on Mongo init failure instead of warning and limping on - getGitStates and onScreenFrame no longer swallow Mongo errors - memory persist() logs the failure and rethrows instead of warning Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaCFWMkYQmTcuPsxaaACft
This commit is contained in:
@@ -14,6 +14,7 @@ import sharp from 'sharp';
|
||||
import { AccessToken } from 'livekit-server-sdk';
|
||||
import { env } from './env.js';
|
||||
import { PodMan } from './agent/podman.js';
|
||||
import { initMemory } from './memory/db.js';
|
||||
|
||||
const POD_ROOM = process.env.POD_ROOM ?? 'demo-pod';
|
||||
const HERMES_IDENTITY = 'podman-hermes';
|
||||
@@ -30,6 +31,10 @@ async function agentToken(room: string): Promise<string> {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// MongoDB is mandatory. Verify the connection before joining the room so bad
|
||||
// creds / unreachable Atlas fail loudly at boot, not silently mid-demo.
|
||||
await initMemory();
|
||||
|
||||
const room = new Room();
|
||||
const podman = new PodMan(room, POD_ROOM);
|
||||
await room.connect(env.LIVEKIT_URL, await agentToken(POD_ROOM), {
|
||||
|
||||
Reference in New Issue
Block a user