From 0dbb8a3319b7d943a81ebab0157b9ff082bb8c64 Mon Sep 17 00:00:00 2001 From: Tianyi Liang Date: Wed, 25 Mar 2026 09:34:39 +0800 Subject: [PATCH 1/2] fix(context): add set_skill setter to unbreak auto_skill_mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When enable_skill_tool=True (the default), the LLM calls search_skill at runtime. The execute engine then invokes _mount_skill_from_result, which calls context.set_skill() — but Context had no such method, causing an uncaught AttributeError that crashes the execute loop. Added Context.set_skill() so the runtime can mount/replace the active skill after build time. Co-Authored-By: Claude Opus 4.6 (1M context) --- dare_framework/context/context.py | 4 ++++ 1 file changed, 4 insertions(+) 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。""" From 63cf0d519e3684b81bb5094f1ee3d4e1ce3324ef Mon Sep 17 00:00:00 2001 From: Tianyi Liang Date: Wed, 25 Mar 2026 10:31:27 +0800 Subject: [PATCH 2/2] fix(context): add set_skill to IContext interface + update feature doc - Declare set_skill() as abstract method on IContext (kernel.py), consistent with the set_tool_gateway pattern - Update feature doc with merged Intent PR link Co-Authored-By: Claude Opus 4.6 (1M context) --- dare_framework/context/kernel.py | 5 +++++ docs/features/fix-context-set-skill.md | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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