refactor: use conversations (#475)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-13 16:40:59 -08:00
committed by GitHub
parent 3615247d14
commit ef7d8c98df
26 changed files with 1572 additions and 168 deletions

View File

@@ -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

View File

@@ -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";