Skip to content

Skills block not updated when reusing existing block #96

@cpfiffer

Description

@cpfiffer

Problem

When creating a new agent with --new, the skills block content is not updated if a skills block already exists for the project. This means changes to .skills/ directory are ignored unless you use --fresh-blocks.

Current Behavior

# Initial setup
mkdir .skills/my-skill
echo "skill content" > .skills/my-skill/SKILL.MD
letta --new  # Creates agent with skills block containing "skill content"

# Later: update skills
echo "updated skill content" > .skills/my-skill/SKILL.MD
letta --new  # ❌ Skills block still has OLD "skill content"

Root Cause

In src/agent/create.ts:

  1. Lines 69-88: Discovers .skills/ and updates defaultMemoryBlocks with fresh content
  2. Lines 122-131: Tries to reuse existing skills block by ID
  3. Lines 140-143: If existing block found, reuses it (with OLD content)
  4. Fresh content is only used when creating NEW block
// Lines 69-88: Fresh .skills/ content loaded
const skillsBlock = defaultMemoryBlocks.find((b) => b.label === "skills");
if (skillsBlock) {
  skillsBlock.value = formatSkillsForMemory(skills, resolvedSkillsDirectory);
}

// Lines 140-143: But if existing block found, reuses OLD content
if (existingBlock?.id) {
  blockIds.push(existingBlock.id);  // ⚠️ Ignores fresh skillsBlock.value above
}

Expected Behavior

Skills block should be updated on every agent creation to reflect current .skills/ directory:

// After loading existing blocks, update skills block with fresh content
const skillsBlockId = localSharedBlockIds.skills;
if (skillsBlockId && skillsBlock) {
  await client.blocks.update(skillsBlockId, {
    value: skillsBlock.value,  // Fresh .skills/ content
  });
}

Workaround

Use --fresh-blocks to force creation of new skills block with fresh content:

letta --fresh-blocks  # Nuclear option: all blocks fresh

Impact

  • Users must use --fresh-blocks to pick up .skills/ changes
  • --fresh-blocks also nukes global blocks (persona/human) which is too destructive
  • Skills are advertised as "automatically discovered" but changes aren't reflected

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions