feat(skill): add MCP refresh hooks #168

Closed
opened 2026-02-22 23:39:47 +00:00 by freemo · 1 comment
Owner

Metadata

  • Commit Message: feat(skill): add MCP refresh hooks
  • Branch: feature/m4-skill-registry-refresh

Background

SkillRegistry.refresh(name) and refresh_all() recompute flattened tool sets on demand. MCP notifications/tools/list_changed events trigger skill refresh and registry cache invalidation. A safeguard skips refresh when the tool registry is unavailable, emitting a single warning with recovery steps.

Acceptance Criteria

  • Implement SkillRegistry.refresh(name) and refresh_all() to recompute flattened tool sets on demand.
  • Wire MCP notifications/tools/list_changed to trigger skill refresh and registry cache invalidation.
  • Add safeguard to skip refresh when tool registry is unavailable; emit a single warning with recovery steps.
  • Add refresh debounce window to avoid repeated refresh storms from MCP notifications.
  • Add refresh result summary (skills refreshed, failures) for CLI output.

Definition of Done

This issue is complete when:

  • All subtasks below are completed and checked off.
  • A Git commit is created where the first line of the commit message matches
    the Commit Message in Metadata exactly, followed by a blank line, then
    additional lines providing relevant details about the implementation. The
    commit body should be appropriate in size for a commit message and relatively
    complete in describing what was done.
  • The commit is pushed to the remote on the branch matching the Branch in
    Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and
    merged before this issue is marked done.

Subtasks

  • Implement SkillRegistry.refresh(name) and refresh_all() to recompute flattened tool sets on demand.
  • Wire MCP notifications/tools/list_changed to trigger skill refresh and registry cache invalidation.
  • Add safeguard to skip refresh when tool registry is unavailable; emit a single warning with recovery steps.
  • Add refresh debounce window to avoid repeated refresh storms from MCP notifications.
  • Add refresh result summary (skills refreshed, failures) for CLI output.
  • Add docs/reference/skill_refresh.md with MCP refresh behavior and troubleshooting.
  • Document debounce defaults and manual refresh usage.
  • Tests (Behave): Add features/skill_refresh.feature scenarios for MCP update propagation.
  • Tests (Robot): Add robot/skill_refresh.robot for refresh smoke tests.
  • Tests (ASV): Add benchmarks/skill_refresh_bench.py for refresh overhead.
  • Verify coverage >=97% via nox -s coverage_report. If coverage is <97% then review the current unit test coverage report at build/coverage.xml and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun nox -s coverage_report to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Section: #### M2: Actor Graphs + Tool Sources (Day 14)
Status: Open

## Metadata - **Commit Message**: `feat(skill): add MCP refresh hooks` - **Branch**: `feature/m4-skill-registry-refresh` ## Background `SkillRegistry.refresh(name)` and `refresh_all()` recompute flattened tool sets on demand. MCP `notifications/tools/list_changed` events trigger skill refresh and registry cache invalidation. A safeguard skips refresh when the tool registry is unavailable, emitting a single warning with recovery steps. ## Acceptance Criteria - [ ] Implement `SkillRegistry.refresh(name)` and `refresh_all()` to recompute flattened tool sets on demand. - [ ] Wire MCP `notifications/tools/list_changed` to trigger skill refresh and registry cache invalidation. - [ ] Add safeguard to skip refresh when tool registry is unavailable; emit a single warning with recovery steps. - [ ] Add refresh debounce window to avoid repeated refresh storms from MCP notifications. - [ ] Add refresh result summary (skills refreshed, failures) for CLI output. ## Definition of Done This issue is complete when: - All subtasks below are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. The commit body should be appropriate in size for a commit message and relatively complete in describing what was done. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. ## Subtasks - [ ] Implement `SkillRegistry.refresh(name)` and `refresh_all()` to recompute flattened tool sets on demand. - [ ] Wire MCP `notifications/tools/list_changed` to trigger skill refresh and registry cache invalidation. - [ ] Add safeguard to skip refresh when tool registry is unavailable; emit a single warning with recovery steps. - [ ] Add refresh debounce window to avoid repeated refresh storms from MCP notifications. - [ ] Add refresh result summary (skills refreshed, failures) for CLI output. - [ ] Add `docs/reference/skill_refresh.md` with MCP refresh behavior and troubleshooting. - [ ] Document debounce defaults and manual refresh usage. - [ ] Tests (Behave): Add `features/skill_refresh.feature` scenarios for MCP update propagation. - [ ] Tests (Robot): Add `robot/skill_refresh.robot` for refresh smoke tests. - [ ] Tests (ASV): Add `benchmarks/skill_refresh_bench.py` for refresh overhead. - [ ] Verify coverage >=97% via `nox -s coverage_report`. If coverage is <97% then review the current unit test coverage report at `build/coverage.xml` and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `nox -s coverage_report` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [ ] Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. **Section**: #### M2: Actor Graphs + Tool Sources (Day 14) **Status**: Open
freemo added this to the v3.1.0 milestone 2026-02-22 23:39:47 +00:00
Author
Owner

Expected completion (Day 15 rebaseline): Day 26 / 2026-03-06

**Expected completion (Day 15 rebaseline):** Day 26 / 2026-03-06
freemo added the due date 2026-02-27 2026-02-23 18:41:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

2026-02-27

Blocks
#393 Epic: Skill & Tool Lifecycle
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#168
No description provided.