UAT: agents resource type add --update not implemented — spec requires overwriting existing custom type definition #4846

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

Bug Report

Feature Area: Resource Registry — agents resource type add --update flag

Severity: Low — update workflow for custom types is broken; users must manually remove and re-add types


What Was Tested

type_add() in src/cleveragents/cli/commands/resource.py — the --update flag behavior.

Expected Behavior (from spec, line 9891)

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

When agents resource type add --config ./my-type.yaml --update is run and the type already exists, the existing definition should be replaced with the new one from the YAML file.

Actual Behavior (from code)

type_add() in resource.py explicitly marks --update as not supported:

if update:
    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

The --update flag is accepted by the CLI but immediately aborts with "Update mode is not yet fully supported" when the type already exists.

Code Location

  • src/cleveragents/cli/commands/resource.pytype_add() function, update branch
  • src/cleveragents/application/services/resource_registry_service.pyregister_type() — raises ValidationError when type already exists, no update path

Fix Required

register_type() should accept an update=True parameter that:

  1. Checks if the type already exists
  2. If yes and update=True: deletes the existing ResourceTypeModel row and inserts the new one
  3. If yes and update=False: raises ValidationError as currently

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

## Bug Report **Feature Area:** Resource Registry — `agents resource type add --update` flag **Severity:** Low — update workflow for custom types is broken; users must manually remove and re-add types --- ## What Was Tested `type_add()` in `src/cleveragents/cli/commands/resource.py` — the `--update` flag behavior. ## Expected Behavior (from spec, line 9891) > `--update`: If the type name already exists, overwrite it. Without this flag, adding a duplicate name fails with an error. When `agents resource type add --config ./my-type.yaml --update` is run and the type already exists, the existing definition should be replaced with the new one from the YAML file. ## Actual Behavior (from code) `type_add()` in `resource.py` explicitly marks `--update` as not supported: ```python if update: 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 ``` The `--update` flag is accepted by the CLI but immediately aborts with "Update mode is not yet fully supported" when the type already exists. ## Code Location - `src/cleveragents/cli/commands/resource.py` — `type_add()` function, `update` branch - `src/cleveragents/application/services/resource_registry_service.py` — `register_type()` — raises `ValidationError` when type already exists, no update path ## Fix Required `register_type()` should accept an `update=True` parameter that: 1. Checks if the type already exists 2. If yes and `update=True`: deletes the existing `ResourceTypeModel` row and inserts the new one 3. If yes and `update=False`: raises `ValidationError` as currently --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 20:18:06 +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#4846
No description provided.