UAT: SkillService.get_dependents() always returns empty actors list — skill remove dependency check never warns about referencing actors #2057

Open
opened 2026-04-03 03:44:55 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/skill-service-get-dependents-empty-actors
  • Commit Message: fix(skill-service): populate actors list in get_dependents() by querying actor registry
  • Milestone: v3.7.0
  • Parent Epic: #936

Background

The SkillService.get_dependents() method always returns {"skills": [...], "actors": []} with a hardcoded empty actors list. This means the agents skill remove command's "Dependency Check" panel never shows actors that reference the skill being removed, even when actors do reference it.

The spec (§agents skill remove) explicitly requires that removing a skill warns about all actors that reference it:

╭─ Dependency Check ─────────────────────────────────╮
│ Warning: 1 skill includes this skill:              │
│ - local/full-stack-dev (will lose devops tools)    │
│ Warning: 2 actors reference this skill:            │
│ - local/code-assistant                             │
│ - local/full-stack-assistant                       │
╰────────────────────────────────────────────────────╯

Affected file: src/cleveragents/application/services/skill_service.py, method get_dependents()

Root cause: SkillService has no reference to the ActorService or actor registry at construction time, so the actors list is hardcoded to []:

def get_dependents(self, name: str) -> dict[str, list[str]]:
    dependent_skills: list[str] = []
    for sname, skill in self._skills.items():
        if sname == name:
            continue
        for inc in skill.includes:
            if inc.name == name:
                dependent_skills.append(sname)
                break
    return {"skills": dependent_skills, "actors": []}  # BUG: actors always empty

Expected fix: SkillService should receive a reference to the actor registry (or ActorService) at construction time, and get_dependents() should query it to find all actors whose skills list includes the given skill name.

Subtasks

  • Inject actor registry (or ActorService) reference into SkillService.__init__()
  • Implement actor dependency query in get_dependents() — iterate actors and check each actor's skills list for the given skill name
  • Update all SkillService construction call-sites to pass the actor registry
  • Add/update Behave unit tests in features/ covering the actors list in get_dependents() output (empty case, single actor, multiple actors)
  • Add/update Robot Framework integration test in robot/ for agents skill remove Dependency Check panel showing actor warnings
  • Update ASV benchmark in benchmarks/ if get_dependents() is benchmarked
  • Verify nox -e typecheck passes (no # type: ignore suppressions)
  • Verify nox -e coverage_report shows coverage ≥ 97%

Definition of Done

  • SkillService.get_dependents() returns the correct non-empty actors list when actors reference the skill
  • agents skill remove Dependency Check panel displays actor warnings as specified in §agents skill remove of the spec
  • All subtasks above are complete
  • All nox stages pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)
  • Coverage ≥ 97%
  • PR has been reviewed by ≥ 2 non-author contributors and merged

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/skill-service-get-dependents-empty-actors` - **Commit Message**: `fix(skill-service): populate actors list in get_dependents() by querying actor registry` - **Milestone**: v3.7.0 - **Parent Epic**: #936 ## Background The `SkillService.get_dependents()` method always returns `{"skills": [...], "actors": []}` with a hardcoded empty actors list. This means the `agents skill remove` command's "Dependency Check" panel never shows actors that reference the skill being removed, even when actors do reference it. The spec (§`agents skill remove`) explicitly requires that removing a skill warns about all actors that reference it: ``` ╭─ Dependency Check ─────────────────────────────────╮ │ Warning: 1 skill includes this skill: │ │ - local/full-stack-dev (will lose devops tools) │ │ Warning: 2 actors reference this skill: │ │ - local/code-assistant │ │ - local/full-stack-assistant │ ╰────────────────────────────────────────────────────╯ ``` **Affected file**: `src/cleveragents/application/services/skill_service.py`, method `get_dependents()` **Root cause**: `SkillService` has no reference to the `ActorService` or actor registry at construction time, so the actors list is hardcoded to `[]`: ```python def get_dependents(self, name: str) -> dict[str, list[str]]: dependent_skills: list[str] = [] for sname, skill in self._skills.items(): if sname == name: continue for inc in skill.includes: if inc.name == name: dependent_skills.append(sname) break return {"skills": dependent_skills, "actors": []} # BUG: actors always empty ``` **Expected fix**: `SkillService` should receive a reference to the actor registry (or `ActorService`) at construction time, and `get_dependents()` should query it to find all actors whose `skills` list includes the given skill name. ## Subtasks - [ ] Inject actor registry (or `ActorService`) reference into `SkillService.__init__()` - [ ] Implement actor dependency query in `get_dependents()` — iterate actors and check each actor's `skills` list for the given skill name - [ ] Update all `SkillService` construction call-sites to pass the actor registry - [ ] Add/update Behave unit tests in `features/` covering the actors list in `get_dependents()` output (empty case, single actor, multiple actors) - [ ] Add/update Robot Framework integration test in `robot/` for `agents skill remove` Dependency Check panel showing actor warnings - [ ] Update ASV benchmark in `benchmarks/` if `get_dependents()` is benchmarked - [ ] Verify `nox -e typecheck` passes (no `# type: ignore` suppressions) - [ ] Verify `nox -e coverage_report` shows coverage ≥ 97% ## Definition of Done - [ ] `SkillService.get_dependents()` returns the correct non-empty actors list when actors reference the skill - [ ] `agents skill remove` Dependency Check panel displays actor warnings as specified in §`agents skill remove` of the spec - [ ] All subtasks above are complete - [ ] All nox stages pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) - [ ] Coverage ≥ 97% - [ ] PR has been reviewed by ≥ 2 non-author contributors and merged --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 03:45:00 +00:00
freemo self-assigned this 2026-04-03 16:58:12 +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".

No due date set.

Reference
cleveragents/cleveragents-core#2057
No description provided.