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
- Start a gateway with a workspace containing
skills/skill-a/
- Begin a session (e.g. via Telegram) — agent correctly sees
skill-a in <available_skills>
- Deploy a new skill to
skills/skill-b/ and restart the gateway
- In the same session, ask the agent about available skills —
skill-b is not listed
- 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
- 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.
- Simpler: On gateway startup, invalidate and rebuild system prompts for all existing sessions (similar to what compaction does).
Related Issues
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
skills/skill-a/skill-ain<available_skills>skills/skill-b/and restart the gatewayskill-bis not listedsessions.jsonfile confirms the system prompt still contains onlyskill-aExpected Behavior
Newly added skills should become visible in existing sessions within a reasonable timeframe, either:
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:
Context
The skill directory watcher (
refresh.ts) andbumpSkillsSnapshotVersion()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
Suggested Approaches
<available_skills>portion of the system prompt.Related Issues