fix: multi-agent state isolation and config.id wiring (#218)

Two bugs from the Phase 1 merge:

1. Store not scoped to agent name: LettaBot constructor passed no agent
   name to Store, so all agents in multi-agent mode shared the same
   agentId/conversationId state. Now passes config.agentName.

2. agentConfig.id ignored: Users could set `id: agent-abc123` in YAML
   but it was never applied. Now checked before store verification.

Written by Cameron ◯ Letta Code

"The best error message is the one that never shows up." -- Thomas Fuchs
This commit is contained in:
Cameron
2026-02-08 21:56:47 -08:00
committed by GitHub
parent 2f5242decd
commit 40586cdc9a
2 changed files with 9 additions and 2 deletions

View File

@@ -481,8 +481,15 @@ async function main() {
},
});
// Verify agent exists (clear stale ID if deleted)
// Apply explicit agent ID from config (before store verification)
let initialStatus = bot.getStatus();
if (agentConfig.id && !initialStatus.agentId) {
console.log(`[Agent:${agentConfig.name}] Using configured agent ID: ${agentConfig.id}`);
bot.setAgentId(agentConfig.id);
initialStatus = bot.getStatus();
}
// Verify agent exists (clear stale ID if deleted)
if (initialStatus.agentId) {
const exists = await agentExists(initialStatus.agentId);
if (!exists) {