fix(context): add set_skill to unbreak auto_skill_mode - #227
Merged
Conversation
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) <noreply@anthropic.com>
- 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) <noreply@anthropic.com>
terrenceeLeung
force-pushed
the
feat/context-set-skill
branch
from
March 25, 2026 02:31
5ea0194 to
63cf0d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow mounting or replacing the current skill at runtime via Context.set_skill().
Summary
Context.set_skill()method andIContext.set_skill()abstract declaration so the execute engine can mount a skill aftersearch_skilltool returns.enable_skill_tool=True(the default) crashes withAttributeErrorwhen the LLM invokessearch_skill, because_mount_skill_from_resultcallscontext.set_skill()which didn't exist.Scope (One PR One Thing)
AttributeErrorcrash in auto_skill_mode when LLM callssearch_skillChanged Files (required)
dare_framework/context/kernel.pyset_skillabstract method toIContextinterface (consistent withset_tool_gatewaypattern)dare_framework/context/context.pydocs/features/fix-context-set-skill.mdIntent / Implementation Gate (required)
mainbefore this implementation started: [x] YesAcceptance Criteria
IContextdeclaresset_skillas abstract methodContext.set_skill()exists and sets_sys_skill_mount_skill_from_resultno longer raisesAttributeErrorenable_skill_tool=False) is unaffectedAcceptance Pack (required)
schema—IContextgainsset_skill(Skill | None) -> Noneabstract method;error semantics— none;retry— nonenone— 4-line setter + 4-line abstract declaration, exercised by existing_mount_skill_from_resultcall pathpytest)none— no new events; fixes an uncaughtAttributeErrorinexecute_engine.py:244Test Evidence (required)
pytestDareAgent._mount_skill_from_result(caller) andContext/IContext(callee)Risk and Rollback
Structured Review Report (required)
Changed Module Boundaries / Public API
IContext.set_skill()added as abstract method (kernel.py)Context.set_skill()added as concrete implementation (context.py)New State
set_skill(None)clears the skillConcurrency / Timeout / Retry
Side Effects and Idempotency
_sys_skillon Context instanceCoverage and Residual Risk
_mount_skill_from_resultIContextimplementations must now implementset_skill(enforced by ABC)Dependency and Lockfile Changes
Agent Rules Checklist (required)
skip/only/excludeusage is explained and reviewed — N/A