Skip to content

bug: skills cleared after compaction without guaranteed re-loading — causes amnesia #315

@Aaronontheweb

Description

@Aaronontheweb

Problem

After compaction, _autoLoadedSkills.Clear() and _autoLoadedSkillContent.Clear() are called (LlmSessionActor.cs:767-768). The skill index context layer is also reset (_startupContextInjected = false).

If the user's next message doesn't happen to match the keyword thresholds for previously loaded skills, the bot loses all skill context — including netclaw-manual, netclaw-identity, and netclaw-diagnostics.

Root Cause

The skill auto-loading mechanism (ResolveAndInjectAutoLoadedSkills) only loads skills that score above their keyword threshold against the current user message. After compaction:

  1. All cached skill content is wiped
  2. The compressed skill index is re-injected (names only, not content)
  3. The user's next message must independently trigger re-matching

System skills like netclaw-manual have elevated thresholds (2.5-3.0) specifically to avoid false positives, but this also makes them harder to re-trigger after compaction.

Impact

  • Bot appears to forget its own identity and capabilities mid-conversation
  • "Who are you?" or "What can you do?" may not re-trigger netclaw-manual if the enriched keywords don't match
  • Users report "split brain" behavior where the bot is knowledgeable, then suddenly loses context

Potential Fixes

  1. Persist auto-loaded skills across compaction — don't clear _autoLoadedSkills; they're already loaded and relevant to this conversation
  2. Re-inject critical skills unconditionally — always inject netclaw-manual and netclaw-identity after compaction regardless of keyword matching
  3. Include skill names in compaction summary prompt — tell the observation builder which skills were active so the summary preserves that context

Relevant Code

  • LlmSessionActor.cs:767-768 — skills cleared in CompactionWorkCompleted
  • LlmSessionActor.cs:1905-1959ResolveAndInjectAutoLoadedSkills
  • SkillRegistry.cs:16-25 — threshold overrides for system skills

Incidents

All three reported sessions exhibited skill loading failures after what appears to be compaction boundaries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions