UAT: agents resource remove refuses to remove resources with edges instead of cascading auto-discovered children — spec requires cascade removal #4837

Open
opened 2026-04-08 20:05:29 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Resource Registry — agents resource remove command

Severity: Medium — resource removal is broken for any resource with auto-discovered children; users cannot remove git-checkout or fs-mount resources


What Was Tested

resource_remove() in src/cleveragents/cli/commands/resource.py.

Expected Behavior (from spec, line 10954)

Removes a registered resource and all its auto-discovered child resources. A git-checkout resource can have hundreds of child resources (files, directories). This operation fails if the resource is linked to any project — use agents project unlink-resource first.

The confirmation prompt should say:

Remove resource local/api-repo and 395 child resources? [y/N]:

After removal, a "Resource Removed" panel should show:

╭─ Resource Removed ──────────────────────────────────╮
│ Name: local/api-repo                                │
│ Type: git-checkout                                  │
│ Children Removed: 395                               │
│ Projects Unlinked: 0                                │
╰─────────────────────────────────────────────────────╯
✓ OK Resource removed

Actual Behavior (from code)

resource_remove() in resource.py refuses to remove any resource that has edges:

edge_count = session.query(ResourceEdgeModel).filter(
    (ResourceEdgeModel.parent_id == res.resource_id)
    | (ResourceEdgeModel.child_id == res.resource_id)
).count()
if edge_count > 0:
    console.print(
        f"[red]Cannot remove resource '{res.name or res.resource_id}': "
        f"{edge_count} edge(s) still reference it.[/red]"
    )
    raise typer.Abort()

This means any git-checkout or fs-mount resource with auto-discovered children cannot be removed — the command always aborts with an error. This is the opposite of the spec behavior.

Additionally:

  • Confirmation prompt says "Remove resource '{name}'?" (no child count)
  • Success output is just "Removed resource: {name}" (no panel with Children Removed / Projects Unlinked)
  • JSON/YAML output missing children_removed field (spec line 11006)

Code Location

  • src/cleveragents/cli/commands/resource.pyresource_remove() function

Impact

Any user who has registered a git-checkout or fs-mount resource (which auto-discovers child resources) cannot remove it. This is a blocking usability issue.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** Resource Registry — `agents resource remove` command **Severity:** Medium — resource removal is broken for any resource with auto-discovered children; users cannot remove git-checkout or fs-mount resources --- ## What Was Tested `resource_remove()` in `src/cleveragents/cli/commands/resource.py`. ## Expected Behavior (from spec, line 10954) > Removes a registered resource **and all its auto-discovered child resources**. A `git-checkout` resource can have hundreds of child resources (files, directories). This operation fails if the resource is linked to any project — use `agents project unlink-resource` first. The confirmation prompt should say: ``` Remove resource local/api-repo and 395 child resources? [y/N]: ``` After removal, a "Resource Removed" panel should show: ``` ╭─ Resource Removed ──────────────────────────────────╮ │ Name: local/api-repo │ │ Type: git-checkout │ │ Children Removed: 395 │ │ Projects Unlinked: 0 │ ╰─────────────────────────────────────────────────────╯ ✓ OK Resource removed ``` ## Actual Behavior (from code) `resource_remove()` in `resource.py` **refuses to remove** any resource that has edges: ```python edge_count = session.query(ResourceEdgeModel).filter( (ResourceEdgeModel.parent_id == res.resource_id) | (ResourceEdgeModel.child_id == res.resource_id) ).count() if edge_count > 0: console.print( f"[red]Cannot remove resource '{res.name or res.resource_id}': " f"{edge_count} edge(s) still reference it.[/red]" ) raise typer.Abort() ``` This means **any git-checkout or fs-mount resource with auto-discovered children cannot be removed** — the command always aborts with an error. This is the opposite of the spec behavior. Additionally: - Confirmation prompt says "Remove resource '{name}'?" (no child count) - Success output is just "Removed resource: {name}" (no panel with Children Removed / Projects Unlinked) - JSON/YAML output missing `children_removed` field (spec line 11006) ## Code Location - `src/cleveragents/cli/commands/resource.py` — `resource_remove()` function ## Impact Any user who has registered a `git-checkout` or `fs-mount` resource (which auto-discovers child resources) cannot remove it. This is a blocking usability issue. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 20:18:01 +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.

Dependencies

No dependencies set.

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