refactor: use conversations (#475)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -283,8 +283,11 @@ export async function skill(args: SkillArgs): Promise<SkillResult> {
|
||||
const { content: skillContent, path: skillPath } =
|
||||
await readSkillContent(skillId, skillsDir);
|
||||
|
||||
// Replace placeholder if this is the first skill
|
||||
if (currentValue === "[CURRENTLY EMPTY]") {
|
||||
// Replace placeholder if this is the first skill (support old and new formats)
|
||||
if (
|
||||
currentValue === "No skills currently loaded." ||
|
||||
currentValue === "[CURRENTLY EMPTY]"
|
||||
) {
|
||||
currentValue = "";
|
||||
}
|
||||
|
||||
@@ -378,7 +381,7 @@ export async function skill(args: SkillArgs): Promise<SkillResult> {
|
||||
// Clean up the value
|
||||
currentValue = currentValue.trim();
|
||||
if (currentValue === "") {
|
||||
currentValue = "[CURRENTLY EMPTY]";
|
||||
currentValue = "No skills currently loaded.";
|
||||
}
|
||||
|
||||
// Update the block
|
||||
|
||||
@@ -54,6 +54,14 @@ export async function ensureCorrectMemoryTool(
|
||||
const currentTools = agentWithTools.tools || [];
|
||||
const mapByName = new Map(currentTools.map((t) => [t.name, t.id]));
|
||||
|
||||
// If agent has no memory tool at all, don't add one
|
||||
// This preserves stateless agents (like Incognito) that intentionally have no memory
|
||||
const hasAnyMemoryTool =
|
||||
mapByName.has("memory") || mapByName.has("memory_apply_patch");
|
||||
if (!hasAnyMemoryTool) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine which memory tool we want
|
||||
// Only OpenAI (Codex) uses memory_apply_patch; Claude and Gemini use memory
|
||||
const desiredMemoryTool = shouldUsePatch ? "memory_apply_patch" : "memory";
|
||||
|
||||
Reference in New Issue
Block a user