diff --git a/dare_framework/context/context.py b/dare_framework/context/context.py index d6b67173..8dde1185 100644 --- a/dare_framework/context/context.py +++ b/dare_framework/context/context.py @@ -115,6 +115,10 @@ def sys_prompt(self) -> Prompt | None: def sys_skill(self) -> Skill | None: return self._sys_skill + def set_skill(self, skill: Skill | None) -> None: + """Mount or replace current skill at runtime. None clears.""" + self._sys_skill = skill + @property def context_window_tokens(self) -> int | None: """LLM 单次请求上下文窗口大小(用于压缩),单位 token。""" diff --git a/dare_framework/context/kernel.py b/dare_framework/context/kernel.py index 50193a25..e4314193 100644 --- a/dare_framework/context/kernel.py +++ b/dare_framework/context/kernel.py @@ -66,6 +66,11 @@ def sys_skill(self) -> Skill | None: """ ... + @abstractmethod + def set_skill(self, skill: Skill | None) -> None: + """Mount or replace the active skill at runtime. None clears.""" + ... + # Short-term memory @abstractmethod diff --git a/docs/features/fix-context-set-skill.md b/docs/features/fix-context-set-skill.md index f6ea45ba..c9eb5225 100644 --- a/docs/features/fix-context-set-skill.md +++ b/docs/features/fix-context-set-skill.md @@ -42,4 +42,5 @@ None. ### Review and Merge Gate Links -- Intent PR: (this document) +- Intent PR: https://github.com/clowder-labs/Deterministic-Agent-Runtime-Engine/pull/228 +- Implementation PR: https://github.com/clowder-labs/Deterministic-Agent-Runtime-Engine/pull/227