MCPcopy Create free account
hub / github.com/GCWing/BitFun / reload_skills_from_disk

Method reload_skills_from_disk

src/apps/cli/src/modes/chat.rs:2895–2919  ·  view source on GitHub ↗

Re-scan skill directories from disk and rebuild the registry cache. Mirrors Claude Code 2.1.152 `/reload-skills`. Safe to call at any time — does not require `is_processing` to be false because the registry swap is atomic and a held `SkillInfo` reference is not kept across the call.

(
        &self,
        chat_view: &mut ChatView,
        chat_state: &mut ChatState,
        rt_handle: &tokio::runtime::Handle,
    )

Source from the content-addressed store, hash-verified

2893 /// registry swap is atomic and a held `SkillInfo` reference is not
2894 /// kept across the call.
2895 fn reload_skills_from_disk(
2896 &self,
2897 chat_view: &mut ChatView,
2898 chat_state: &mut ChatState,
2899 rt_handle: &tokio::runtime::Handle,
2900 ) {
2901 let registry = SkillRegistry::global();
2902 let workspace = self.agent.workspace_path_buf();
2903 let outcome = tokio::task::block_in_place(|| {
2904 // refresh() is the global re-scan entry point; the workspace
2905 // arg of refresh_for_workspace is currently a no-op upstream,
2906 // so we call refresh() directly and re-resolve the workspace
2907 // count afterwards.
2908 rt_handle.block_on(async {
2909 registry.refresh().await;
2910 registry
2911 .get_resolved_skills_for_workspace(Some(workspace.as_path()), None)
2912 .await
2913 })
2914 });
2915
2916 let count = outcome.len();
2917 chat_state.add_system_message(format!("Reloaded {} skill(s) from disk.", count));
2918 chat_view.set_status(Some(format!("Skills reloaded ({} available)", count)));
2919 }
2920
2921 fn show_available_skill_list(
2922 &self,

Callers 1

handle_commandMethod · 0.80

Calls 7

globalFunction · 0.85
add_system_messageMethod · 0.80
workspace_path_bufMethod · 0.45
refreshMethod · 0.45
lenMethod · 0.45
set_statusMethod · 0.45

Tested by

no test coverage detected