reload • AI Agent SDK
reload: Re-scan skill sources and refresh the in-memory index.
reload
Method
</div>
This is a method of the SkillManager class in the manager module.
Re-scan skill sources and refresh the in-memory index.
Re-runs discovery over the same directories the manager was last discovered with, diffs the result against the current registry, and swaps the index atomically. This lets a live session pick up newly installed/edited/removed skills without a restart.
Behaviour:
- added — a new SKILL.md appeared: loaded fresh (metadata only).
- changed — an existing skill’s SKILL.md content changed on disk:
- reloaded fresh so cached instructions are dropped.
- removed — the skill directory disappeared: dropped from the
- index and deactivated (its cached instructions are cleared).
- unchanged skills keep their existing `
LoadedSkill` (and thus any - activated instructions / usage telemetry).
The prompt-cache concern is respected: this method only mutates the in-memory index. Callers build the skills prompt from the index on the
next turn (:meth:to_prompt), so an index change never takes effect mid-turn.
Signature
def reload() -> Dict[str, List[str]]Returns
Dict[str, List[str]]Dict with `added, changed and removed lists of skill names (sorted), suitable for a +added/~changed/-removed` report.
Uses
discover_skillsnew_props.setdefaultLoadedSkill
Source
View on GitHubpraisonaiagents/skills/manager.py at line 133