sync update from LAN repo (source master @ 6e3f02a2)

This commit is contained in:
gozeros committed 2026-11-17 11:28:22 +08:00
1 parent 66a443e915
commit 6c25c89d93
431 files changed
+68511 -2240

No files matched your search

@@ -18,6 +18,13 @@ logger = logging.getLogger(__name__)
_SKILL_NAME_PATTERN = re.compile(r"^[a-z0-9]+(?:[_-][a-z0-9]+)*$")
def _process_skill_storage():
"""Return the process singleton without creating one."""
from deerflow.skills.storage import _default_skill_storage
return _default_skill_storage
class SkillStorage(ABC):
"""Abstract base for skill storage backends.
@@ -295,6 +302,27 @@ class SkillStorage(ABC):
return skills
def invalidate_skills_cache(self) -> None:
"""Drop the parsed skill catalogue so the next load re-reads disk.
Gateway routes build a fresh storage for the request, while agent runs
read the process singleton. Clearing both keeps a save visible before
the one-second metadata check interval elapses.
"""
self._clear_skills_cache()
singleton = _process_skill_storage()
if singleton is None or singleton is self:
return
clear = getattr(singleton, "_clear_skills_cache", None)
if clear is not None:
clear()
def _clear_skills_cache(self) -> None:
with self._skills_cache_lock:
self._skills_cache_signature = None
self._skills_cache = ()
self._skills_cache_checked_at = 0.0
def ensure_custom_skill_is_editable(self, name: str) -> None:
"""Origin: ``deerflow.skills.manager.ensure_custom_skill_is_editable``."""
if self.custom_skill_exists(name):