Skip to content

Skills added after session creation not visible until new session #12092

@jeanlucthumm

Description

@jeanlucthumm

Description

Skills added to the workspace skills/ directory after a session has been created are not visible to that session. The <available_skills> XML block in the system prompt is built once at session creation and never refreshed, so the agent cannot discover or use newly deployed skills.

This is particularly impactful for gateway deployments (e.g. Telegram) where sessions are long-lived and restarting the gateway does not help — the existing session retains its stale system prompt.

Steps to Reproduce

  1. Start a gateway with a workspace containing skills/skill-a/
  2. Begin a session (e.g. via Telegram) — agent correctly sees skill-a in <available_skills>
  3. Deploy a new skill to skills/skill-b/ and restart the gateway
  4. In the same session, ask the agent about available skills — skill-b is not listed
  5. The sessions.json file confirms the system prompt still contains only skill-a

Expected Behavior

Newly added skills should become visible in existing sessions within a reasonable timeframe, either:

  • On gateway restart
  • On next message in the session
  • Via a skill version bump mechanism (the bumpSkillsSnapshotVersion / file watcher infrastructure exists but doesn't update session prompts)

Actual Behavior

The skill list is permanently stale for the lifetime of the session. The only way to pick up new skills is:

  • Start a new session
  • Wait for compaction (which rebuilds the system prompt from scratch)

Context

The skill directory watcher (refresh.ts) and bumpSkillsSnapshotVersion() exist and detect filesystem changes, but only trigger remote node bin refreshes — they don't update existing session system prompts.

During compaction (compact.ts:203-208), resolveSkillsPromptForRun() is called again and the system prompt IS rebuilt with current skills. So the infrastructure to refresh exists, it's just not triggered outside of compaction.

Environment

  • OpenClaw version: latest main (2026-02-08)
  • Deployment: NixOS gateway with Telegram provider

Suggested Approaches

  1. Lightweight: On each new message, check if the skills snapshot version has changed since the session was created. If so, rebuild just the <available_skills> portion of the system prompt.
  2. Simpler: On gateway startup, invalidate and rebuild system prompts for all existing sessions (similar to what compaction does).

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    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