fix: auto-create missing skills blocks when resuming older agents (#559)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
import { getClient } from "./agent/client";
|
||||
import { initializeLoadedSkillsFlag, setAgentContext } from "./agent/context";
|
||||
import { createAgent } from "./agent/create";
|
||||
import { ISOLATED_BLOCK_LABELS } from "./agent/memory";
|
||||
import { ensureSkillsBlocks, ISOLATED_BLOCK_LABELS } from "./agent/memory";
|
||||
import { sendMessageStream } from "./agent/message";
|
||||
import { getModelUpdateArgs } from "./agent/model";
|
||||
import { SessionStats } from "./agent/stats";
|
||||
@@ -529,6 +529,12 @@ export async function handleHeadlessCommand(
|
||||
conversationId,
|
||||
});
|
||||
|
||||
// Ensure the agent has the required skills blocks (for backwards compatibility)
|
||||
const createdBlocks = await ensureSkillsBlocks(agent.id);
|
||||
if (createdBlocks.length > 0) {
|
||||
console.log("Created missing skills blocks for agent compatibility");
|
||||
}
|
||||
|
||||
// Set agent context for tools that need it (e.g., Skill tool, Task tool)
|
||||
setAgentContext(agent.id, skillsDirectory);
|
||||
await initializeLoadedSkillsFlag();
|
||||
|
||||
Reference in New Issue
Block a user