UAT: agents resource type add --update flag is not implemented — shows "not yet fully supported" error #5615

Open
opened 2026-04-09 07:49:48 +00:00 by HAL9000 · 2 comments
Owner

Bug Report

Feature Area: Resource Types — agents resource type add

Severity: Critical (milestone-blocking — v3.6.0 deliverable #12: "Cloud resource types stubbed with NotImplementedError" and custom resource type registration)

What Was Tested

Code-level analysis of src/cleveragents/cli/commands/resource.py against the specification's agents resource type add --update behavior.

Expected Behavior (from spec §agents resource type add)

The spec states:

--update: If the type name already exists, overwrite it. Without this flag, adding a duplicate name fails with an error.

The --update flag should allow re-registering an existing custom resource type by overwriting the existing definition.

Actual Behavior

In src/cleveragents/cli/commands/resource.py lines 235-246:

if update:
    # Try to register; if it already exists, show a message
    try:
        spec = service.register_type(config)
    except ValidationError as exc:
        if "already exists" in str(exc):
            console.print(
                "[yellow]Resource type already exists. "
                "Update mode is not yet fully supported.[/yellow]"
            )
            raise typer.Abort() from exc
        raise

When --update is passed and the type already exists, the CLI prints "Update mode is not yet fully supported." and aborts. The register_type() service method also does not support updating — it always raises ValidationError if the type already exists (lines 263-270 of resource_registry_service.py):

existing = session.query(ResourceTypeModel).filter_by(name=spec.name).first()
if existing is not None:
    raise ValidationError(
        message=f"Resource type '{spec.name}' already exists",
        details={"name": spec.name},
    )

Steps to Reproduce

  1. Register a custom resource type: agents resource type add --config ./my-type.yaml
  2. Modify the YAML config
  3. Re-register with update: agents resource type add --config ./my-type.yaml --update
  4. Observe: "Resource type already exists. Update mode is not yet fully supported." error

Code Locations

  • CLI: src/cleveragents/cli/commands/resource.py lines 235-246 (type_add function)
  • Service: src/cleveragents/application/services/resource_registry_service.py lines 263-270 (register_type method)

Fix Required

  1. ResourceRegistryService.register_type() should accept an update: bool parameter. When True and the type exists, it should update the existing ResourceTypeModel row instead of raising.
  2. The CLI type_add command should pass update=True to the service when --update is specified.
  3. The update should also re-validate the inheritance chain.

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

## Bug Report **Feature Area**: Resource Types — `agents resource type add` **Severity**: Critical (milestone-blocking — v3.6.0 deliverable #12: "Cloud resource types stubbed with `NotImplementedError`" and custom resource type registration) ### What Was Tested Code-level analysis of `src/cleveragents/cli/commands/resource.py` against the specification's `agents resource type add --update` behavior. ### Expected Behavior (from spec §agents resource type add) The spec states: > `--update`: If the type name already exists, overwrite it. Without this flag, adding a duplicate name fails with an error. The `--update` flag should allow re-registering an existing custom resource type by overwriting the existing definition. ### Actual Behavior In `src/cleveragents/cli/commands/resource.py` lines 235-246: ```python if update: # Try to register; if it already exists, show a message try: spec = service.register_type(config) except ValidationError as exc: if "already exists" in str(exc): console.print( "[yellow]Resource type already exists. " "Update mode is not yet fully supported.[/yellow]" ) raise typer.Abort() from exc raise ``` When `--update` is passed and the type already exists, the CLI prints "Update mode is not yet fully supported." and aborts. The `register_type()` service method also does not support updating — it always raises `ValidationError` if the type already exists (lines 263-270 of `resource_registry_service.py`): ```python existing = session.query(ResourceTypeModel).filter_by(name=spec.name).first() if existing is not None: raise ValidationError( message=f"Resource type '{spec.name}' already exists", details={"name": spec.name}, ) ``` ### Steps to Reproduce 1. Register a custom resource type: `agents resource type add --config ./my-type.yaml` 2. Modify the YAML config 3. Re-register with update: `agents resource type add --config ./my-type.yaml --update` 4. Observe: "Resource type already exists. Update mode is not yet fully supported." error ### Code Locations - CLI: `src/cleveragents/cli/commands/resource.py` lines 235-246 (`type_add` function) - Service: `src/cleveragents/application/services/resource_registry_service.py` lines 263-270 (`register_type` method) ### Fix Required 1. `ResourceRegistryService.register_type()` should accept an `update: bool` parameter. When `True` and the type exists, it should update the existing `ResourceTypeModel` row instead of raising. 2. The CLI `type_add` command should pass `update=True` to the service when `--update` is specified. 3. The update should also re-validate the inheritance chain. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-09 07:56:34 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Author
Owner

Hierarchical Compliance Fix: This issue was detected as an orphan (no parent Epic).

Solution: Linked to Epic #5502 (Actor Execution & Configuration — GRAPH Actor, Config Schema & CLI Compliance) as resource type CLI compliance is part of the actor/resource configuration scope.

Hierarchy: Issue #5615 → Epic #5502 → Legendary #4944


Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

**Hierarchical Compliance Fix**: This issue was detected as an orphan (no parent Epic). **Solution**: Linked to Epic #5502 (Actor Execution & Configuration — GRAPH Actor, Config Schema & CLI Compliance) as resource type CLI compliance is part of the actor/resource configuration scope. **Hierarchy**: Issue #5615 → Epic #5502 → Legendary #4944 --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
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#5615
No description provided.