UAT: agents resource list --type does not accept regex — spec says it should filter by regex pattern #6476

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

Bug Report

Feature Area

Resource System — agents resource list --type regex filtering

Spec Reference

docs/specification.md §11041 (agents resource list arguments)

From spec §11041:

  • --type/-t TYPE: Filter by resource type (accepts a regex).

Expected Behavior (from spec)

agents resource list --type "git.*" should return all resources whose type matches the regex git.* — i.e., all git-checkout, git, git-remote, git-branch, git-commit, git-tree, git-tree-entry, git-stash, git-submodule, git-tag resources.

Actual Behavior

Running agents resource list --type "git.*" returns:

No resources found.

The implementation treats --type as an exact type name (with subtype matching via ADR-042 inheritance), not as a regex. The value "git.*" is passed to service.list_resources(type_name="git.*") which looks for a type named literally "git.*" — which doesn't exist.

Running agents resource list --type "git-checkout" works correctly (returns git-checkout resources).

Root Cause (Code Analysis)

src/cleveragents/cli/commands/resource.py line 848–851:

resources = service.list_resources(
    type_name=type_filter,
    include_auto_discovered=show_all,
)

The type_filter is passed directly to list_resources() as an exact type name. There is no regex compilation or matching against type names.

src/cleveragents/application/services/_resource_registry_ops.py lines 200–209:

if type_name is not None:
    if exact:
        query = query.filter_by(type_name=type_name)
    else:
        # ADR-042: polymorphic listing — include subtypes
        registry = self._load_type_registry()
        subtypes = find_subtypes(type_name, registry)
        all_types = [type_name, *subtypes]
        query = query.filter(ResourceModel.type_name.in_(all_types))

This does subtype matching (ADR-042 polymorphism) but not regex matching.

Steps to Reproduce

# Should return all git-* resources but returns nothing
agents resource list --type "git.*"

# Should return all physical resources but returns nothing
agents resource list --type "physical"

# This works (exact match + subtypes)
agents resource list --type "git-checkout"

Code Location

  • src/cleveragents/cli/commands/resource.py lines 817–912: resource_list() — no regex compilation for --type
  • src/cleveragents/application/services/_resource_registry_ops.py lines 177–216: list_resources() — no regex support

Severity

Medium — users cannot filter resources by type pattern (e.g., git.* to see all git-related resources). The spec explicitly says the --type option accepts a regex.


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

## Bug Report ### Feature Area Resource System — `agents resource list --type` regex filtering ### Spec Reference `docs/specification.md` §11041 (`agents resource list` arguments) From spec §11041: > - `--type/-t TYPE`: Filter by resource type (accepts a regex). ### Expected Behavior (from spec) `agents resource list --type "git.*"` should return all resources whose type matches the regex `git.*` — i.e., all `git-checkout`, `git`, `git-remote`, `git-branch`, `git-commit`, `git-tree`, `git-tree-entry`, `git-stash`, `git-submodule`, `git-tag` resources. ### Actual Behavior Running `agents resource list --type "git.*"` returns: ``` No resources found. ``` The implementation treats `--type` as an exact type name (with subtype matching via ADR-042 inheritance), not as a regex. The value `"git.*"` is passed to `service.list_resources(type_name="git.*")` which looks for a type named literally `"git.*"` — which doesn't exist. Running `agents resource list --type "git-checkout"` works correctly (returns git-checkout resources). ### Root Cause (Code Analysis) `src/cleveragents/cli/commands/resource.py` line 848–851: ```python resources = service.list_resources( type_name=type_filter, include_auto_discovered=show_all, ) ``` The `type_filter` is passed directly to `list_resources()` as an exact type name. There is no regex compilation or matching against type names. `src/cleveragents/application/services/_resource_registry_ops.py` lines 200–209: ```python if type_name is not None: if exact: query = query.filter_by(type_name=type_name) else: # ADR-042: polymorphic listing — include subtypes registry = self._load_type_registry() subtypes = find_subtypes(type_name, registry) all_types = [type_name, *subtypes] query = query.filter(ResourceModel.type_name.in_(all_types)) ``` This does subtype matching (ADR-042 polymorphism) but not regex matching. ### Steps to Reproduce ```bash # Should return all git-* resources but returns nothing agents resource list --type "git.*" # Should return all physical resources but returns nothing agents resource list --type "physical" # This works (exact match + subtypes) agents resource list --type "git-checkout" ``` ### Code Location - `src/cleveragents/cli/commands/resource.py` lines 817–912: `resource_list()` — no regex compilation for `--type` - `src/cleveragents/application/services/_resource_registry_ops.py` lines 177–216: `list_resources()` — no regex support ### Severity Medium — users cannot filter resources by type pattern (e.g., `git.*` to see all git-related resources). The spec explicitly says the `--type` option accepts a regex. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
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#6476
No description provided.