UAT: agents resource inspect --tree shows DAG resource children instead of filesystem file tree #6800

Open
opened 2026-04-10 02:07:28 +00:00 by HAL9000 · 0 comments
Owner

What Was Tested

agents resource inspect <RESOURCE> --tree — the output of the --tree flag.

Expected Behavior (from spec §agents resource inspect)

The spec states:

Purpose: Inspect a resource's contents. For file-based resources (git checkouts, filesystem mounts, directories), displays the file tree or the contents of a specific file.

The spec's --tree example shows a filesystem directory tree:

Resource Tree: local/api-repo

/home/user/projects/api-service
+-- src/
|   +-- api/
|   |   +-- __init__.py
|   |   +-- auth/
|   |   |   +-- auth_middleware.py
...
+-- tests/
+-- README.md
+-- pyproject.toml

Summary
  Directories: 8
  Files: 41
  Total Size: 284 KB

The spec's JSON output for resource inspect --tree confirms this as a filesystem hierarchy with name, type: "file"/"directory", and children of the file system, not the resource registry DAG:

{
  "data": {
    "resource": "local/api-repo",
    "mode": "tree",
    "root": "/home/user/projects/api-service",
    "tree": [
      { "name": "src/", "type": "directory", "children": [...] },
      { "name": "tests/", "type": "directory" },
      { "name": "README.md", "type": "file" },
      { "name": "pyproject.toml", "type": "file" }
    ],
    "summary": { "directories": 8, "files": 41, "total_size_bytes": 291000 }
  }
}

The spec also explicitly distinguishes the two commands:

  • agents resource inspect --tree = file/content tree (actual filesystem view)
  • agents resource tree = DAG tree view of registered child resources

Actual Behavior

The implementation of resource_inspect() in src/cleveragents/cli/commands/resource.py calls service.get_resource_tree() for the --tree flag — which is the same function that resource_tree uses. This returns registered resource registry children (e.g., git-checkoutgit, git-remote, fs-directory, etc.), NOT the actual filesystem file tree.

# resource.py, resource_inspect() -- wrong: uses DAG tree instead of filesystem tree
if tree:
    tree_data = service.get_resource_tree(resource, depth=-1)
    data["children"] = _tree_to_dict(...)

The output therefore shows resource objects like {name: "01HXR1A1B2C3...", type: "git-remote"} rather than {name: "auth_middleware.py", type: "file"}.

Additionally, the spec-required summary (directories, files, total_size_bytes) is never computed or returned.

Steps to Reproduce

agents resource add git-checkout local/test-repo --path /tmp
agents resource inspect local/test-repo --tree --format json

Observe:

  1. Output shows DAG child resources (resource registry children) instead of filesystem files/dirs
  2. No root, mode, or summary fields in the JSON output
  3. Nodes have resource_id keys, not name/type: "file"/"directory" as the spec requires

Affected File

src/cleveragents/cli/commands/resource.pyresource_inspect() function: the --tree implementation should walk the filesystem at the resource's location, not call get_resource_tree().


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

## What Was Tested `agents resource inspect <RESOURCE> --tree` — the output of the `--tree` flag. ## Expected Behavior (from spec §agents resource inspect) The spec states: > **Purpose**: Inspect a resource's contents. For file-based resources (git checkouts, filesystem mounts, directories), displays the **file tree** or the contents of a specific file. The spec's `--tree` example shows a **filesystem directory tree**: ``` Resource Tree: local/api-repo /home/user/projects/api-service +-- src/ | +-- api/ | | +-- __init__.py | | +-- auth/ | | | +-- auth_middleware.py ... +-- tests/ +-- README.md +-- pyproject.toml Summary Directories: 8 Files: 41 Total Size: 284 KB ``` The spec's JSON output for `resource inspect --tree` confirms this as a filesystem hierarchy with `name`, `type: "file"/"directory"`, and `children` of the **file system**, not the resource registry DAG: ```json { "data": { "resource": "local/api-repo", "mode": "tree", "root": "/home/user/projects/api-service", "tree": [ { "name": "src/", "type": "directory", "children": [...] }, { "name": "tests/", "type": "directory" }, { "name": "README.md", "type": "file" }, { "name": "pyproject.toml", "type": "file" } ], "summary": { "directories": 8, "files": 41, "total_size_bytes": 291000 } } } ``` The spec also explicitly distinguishes the two commands: - `agents resource inspect --tree` = **file/content tree** (actual filesystem view) - `agents resource tree` = **DAG tree view** of registered child resources ## Actual Behavior The implementation of `resource_inspect()` in `src/cleveragents/cli/commands/resource.py` calls `service.get_resource_tree()` for the `--tree` flag — which is the **same function that `resource_tree` uses**. This returns registered resource registry children (e.g., `git-checkout` → `git`, `git-remote`, `fs-directory`, etc.), NOT the actual filesystem file tree. ```python # resource.py, resource_inspect() -- wrong: uses DAG tree instead of filesystem tree if tree: tree_data = service.get_resource_tree(resource, depth=-1) data["children"] = _tree_to_dict(...) ``` The output therefore shows resource objects like `{name: "01HXR1A1B2C3...", type: "git-remote"}` rather than `{name: "auth_middleware.py", type: "file"}`. Additionally, the spec-required `summary` (`directories`, `files`, `total_size_bytes`) is never computed or returned. ## Steps to Reproduce ```bash agents resource add git-checkout local/test-repo --path /tmp agents resource inspect local/test-repo --tree --format json ``` Observe: 1. Output shows DAG child resources (resource registry children) instead of filesystem files/dirs 2. No `root`, `mode`, or `summary` fields in the JSON output 3. Nodes have `resource_id` keys, not `name`/`type: "file"/"directory"` as the spec requires ## Affected File `src/cleveragents/cli/commands/resource.py` — `resource_inspect()` function: the `--tree` implementation should walk the filesystem at the resource's location, not call `get_resource_tree()`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:07:34 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:42 +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#6800
No description provided.