feat(skill): add MCP refresh hooks #455
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!455
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/m4-skill-registry-refresh"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Implements MCP refresh hooks for the skill registry. Adds
SkillRegistry.refresh(name)and
refresh_all()to recompute flattened tool sets on demand, and wires MCPnotifications/tools/list_changedevents to trigger them via a newMCPRefreshHookclass with configurable debouncing. Introduces
SkillRefreshResultfor structuredrefresh outcome reporting.
Type of Change
Quality Checklist
Anyunless justified)nox -s typecheckpasses with no errorsnox -s lintpasses with no errorsfeatures/)robot/) if applicablenox -s coverage_report)nox -s security_scan)nox -s dead_code)Testing
Behave unit tests were written before implementation (BDD-first). All tests
passed after implementation with no modifications to the test expectations.
Test Commands Run
Related Issues
ISSUES CLOSED #168
Implementation Notes
New components
SkillRefreshResult(src/cleveragents/skills/refresh.py)Immutable frozen dataclass summarising a refresh operation with
refreshed,failed, andskippedlists/dicts. Providesto_summary()for one-lineCLI/log output and
merge()for aggregating per-skill results inrefresh_all().MCPRefreshHook(src/cleveragents/mcp/refresh_hook.py)Registers itself as a notification listener on an
MCPToolAdapter. On receivingnotifications/tools/list_changed, it schedules athreading.Timerto callSkillRegistry.refresh_all()afterdebounce_seconds(default 0.5 s). Eachnew notification resets the timer, coalescing bursts into a single refresh.
Thread-safe via
threading.Lock. Exposesrefresh_countandcancel().Modified components
SkillRegistry(src/cleveragents/skills/registry.py)Added
refresh(name)andrefresh_all(). Resolves tools viaSkillResolver,validates refs against
ToolRegistryif configured, returnsSkillRefreshResult.MCPToolAdapter(src/cleveragents/mcp/adapter.py)Added
add_notification_listener(callback)anddispatch_notification(method, params)for a generic, loosely-coupled notification fan-out mechanism.
Key design decisions
emit multiple
list_changednotifications in quick succession.ToolRegistryis configured,refresh()skipsvalidation and counts the skill as refreshed, logging a single
WARNINGwithrecovery steps rather than failing hard.
SkillRefreshResultisfrozen=Trueso callerscannot mutate shared results passed across thread boundaries.
feature/m4-skill-registry-refreshto feat(skill): add MCP refresh hooksTests passing, changelog updated, documentation updated. Looks good. Approving
New commits pushed, approval review dismissed automatically according to repository settings