Skip to content

Skills snapshot not invalidated on /restart or gateway restart #54938

@jensen-srp

Description

@jensen-srp

Bug

When a new skill is added (either via config allowlist or by placing it in a workspace/managed skills directory), the skillsSnapshot cached in sessions.json is not invalidated by /restart or gateway restart. The stale snapshot persists and the new skill never appears in the session prompt.

Steps to Reproduce

  1. Have an existing session with a cached skillsSnapshot in sessions.json
  2. Add a new skill to the workspace skills directory (e.g. <workspace>/skills/my-skill/SKILL.md)
  3. Add the skill name to the agent's skills allowlist in config (if applicable)
  4. Gateway restart (SIGUSR1) or /restart command
  5. Send a message in the session

Expected: The skill appears in the session's available skills list
Actual: The skill does not appear. The stale skillsSnapshot from sessions.json is reused.

Evidence

  • Gateway logs confirm the skill is loaded (Discord slash command count increased from 133 to 134)
  • The skillsSnapshot field in sessions.json for the session does not contain the new skill
  • Multiple gateway restarts and /restart commands did not clear the snapshot
  • Manually deleting the skillsSnapshot key from sessions.json and restarting fixed the issue

Environment

  • OpenClaw 2026.3.24
  • macOS (arm64)
  • Multi-agent setup with per-agent skills allowlist

Workaround

Manually delete the skillsSnapshot field from the affected session in <agentDir>/sessions/sessions.json and restart the gateway.

Suggested Fix

/restart (and gateway restart) should invalidate the skillsSnapshot so it rebuilds on the next turn. Alternatively, compare a hash of the current eligible skills against the cached snapshot and refresh if stale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions