UAT Bug: agents resource type add --update flag is documented but always aborts with "Update mode is not yet fully supported" #2401

Open
opened 2026-04-03 17:33:16 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/resource-type-add-update-flag
  • Commit Message: fix(cli): implement --update flag for agents resource type add command
  • Milestone: v3.6.0
  • Parent Epic: #398

Bug Report

What Was Tested

The agents resource type add --update CLI flag in src/cleveragents/cli/commands/resource.py.

Expected Behavior (from spec)

The --update flag on agents resource type add should allow updating an existing resource type definition. The flag is documented in the CLI help text and is part of the public CLI interface.

Actual Behavior

In src/cleveragents/cli/commands/resource.py, the type_add() function explicitly handles the --update flag but immediately aborts with a "not yet fully supported" message:

@type_app.command("add")
def type_add(
    ...
    update: Annotated[
        bool,
        typer.Option("--update", help="Update if type already exists"),
    ] = False,
    ...
) -> None:
    ...
    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 shown in agents resource type add --help output, leading users to believe it works, but it always aborts when the type already exists.

Impact

  1. Users cannot update existing resource type definitions — they must remove and re-add the type
  2. Misleading CLI help — the flag is documented but non-functional
  3. Workflow disruption — updating a resource type requires a manual remove + re-add cycle

Steps to Reproduce

# Create a custom resource type YAML file
agents resource type add --config my-type.yaml
# Modify the YAML file
agents resource type add --config my-type.yaml --update
# Expected: type is updated
# Actual: "Resource type already exists. Update mode is not yet fully supported." + abort

Code Location

  • src/cleveragents/cli/commands/resource.pytype_add() function, the if update: branch

Subtasks

  • Implement update_type(config_path) method in ResourceRegistryService
  • Add validation in update_type(): cannot change built_in status, cannot change type name
  • Update type_add() CLI command to call service.update_type() when --update is passed and type already exists
  • Remove the "Update mode is not yet fully supported" abort path
  • Tests (Behave): Add unit tests for ResourceRegistryService.update_type() — success path
  • Tests (Behave): Add unit tests for ResourceRegistryService.update_type() — validation error paths (built_in change, name change)
  • Tests (Behave): Add unit tests for type_add() CLI command with --update flag — type exists and is updated
  • Tests (Behave): Add unit tests for type_add() CLI command with --update flag — type does not exist (should still create)
  • Tests (Robot): Add integration test for agents resource type add --update end-to-end flow
  • Verify nox -e typecheck passes (full static typing on new method)
  • Verify nox -e coverage_report shows coverage >= 97%

Definition of Done

  • All subtasks above are completed
  • update_type() method is implemented in ResourceRegistryService with full static typing
  • type_add() CLI command correctly delegates to update_type() when --update is passed and the type already exists
  • Validation prevents changing built_in status or type name during an update
  • The "Update mode is not yet fully supported" abort path is removed
  • All new code paths are covered by Behave unit tests
  • Integration test covers the end-to-end --update flow via Robot Framework
  • The commit is created with the exact first line: fix(cli): implement --update flag for agents resource type add command
  • The commit is pushed to branch fix/resource-type-add-update-flag
  • A Pull Request is created, reviewed, and merged
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/resource-type-add-update-flag` - **Commit Message**: `fix(cli): implement --update flag for agents resource type add command` - **Milestone**: v3.6.0 - **Parent Epic**: #398 ## Bug Report ### What Was Tested The `agents resource type add --update` CLI flag in `src/cleveragents/cli/commands/resource.py`. ### Expected Behavior (from spec) The `--update` flag on `agents resource type add` should allow updating an existing resource type definition. The flag is documented in the CLI help text and is part of the public CLI interface. ### Actual Behavior In `src/cleveragents/cli/commands/resource.py`, the `type_add()` function explicitly handles the `--update` flag but immediately aborts with a "not yet fully supported" message: ```python @type_app.command("add") def type_add( ... update: Annotated[ bool, typer.Option("--update", help="Update if type already exists"), ] = False, ... ) -> None: ... 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 shown in `agents resource type add --help` output, leading users to believe it works, but it always aborts when the type already exists. ### Impact 1. **Users cannot update existing resource type definitions** — they must remove and re-add the type 2. **Misleading CLI help** — the flag is documented but non-functional 3. **Workflow disruption** — updating a resource type requires a manual remove + re-add cycle ### Steps to Reproduce ```bash # Create a custom resource type YAML file agents resource type add --config my-type.yaml # Modify the YAML file agents resource type add --config my-type.yaml --update # Expected: type is updated # Actual: "Resource type already exists. Update mode is not yet fully supported." + abort ``` ### Code Location - `src/cleveragents/cli/commands/resource.py` — `type_add()` function, the `if update:` branch ## Subtasks - [ ] Implement `update_type(config_path)` method in `ResourceRegistryService` - [ ] Add validation in `update_type()`: cannot change `built_in` status, cannot change type name - [ ] Update `type_add()` CLI command to call `service.update_type()` when `--update` is passed and type already exists - [ ] Remove the "Update mode is not yet fully supported" abort path - [ ] Tests (Behave): Add unit tests for `ResourceRegistryService.update_type()` — success path - [ ] Tests (Behave): Add unit tests for `ResourceRegistryService.update_type()` — validation error paths (built_in change, name change) - [ ] Tests (Behave): Add unit tests for `type_add()` CLI command with `--update` flag — type exists and is updated - [ ] Tests (Behave): Add unit tests for `type_add()` CLI command with `--update` flag — type does not exist (should still create) - [ ] Tests (Robot): Add integration test for `agents resource type add --update` end-to-end flow - [ ] Verify `nox -e typecheck` passes (full static typing on new method) - [ ] Verify `nox -e coverage_report` shows coverage >= 97% ## Definition of Done - [ ] All subtasks above are completed - [ ] `update_type()` method is implemented in `ResourceRegistryService` with full static typing - [ ] `type_add()` CLI command correctly delegates to `update_type()` when `--update` is passed and the type already exists - [ ] Validation prevents changing `built_in` status or type name during an update - [ ] The "Update mode is not yet fully supported" abort path is removed - [ ] All new code paths are covered by Behave unit tests - [ ] Integration test covers the end-to-end `--update` flow via Robot Framework - [ ] The commit is created with the exact first line: `fix(cli): implement --update flag for agents resource type add command` - [ ] The commit is pushed to branch `fix/resource-type-add-update-flag` - [ ] A Pull Request is created, reviewed, and merged - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-03 17:33:20 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — The --update flag is documented and accepted but always aborts. This is a broken feature, not a missing one.
  • Milestone: v3.6.0
  • MoSCoW: Should Have — Resource type updates are important for iterative development workflows but not blocking core resource type creation.
  • Parent Epic: #398 (Post-MVP Resources)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — The `--update` flag is documented and accepted but always aborts. This is a broken feature, not a missing one. - **Milestone**: v3.6.0 - **MoSCoW**: Should Have — Resource type updates are important for iterative development workflows but not blocking core resource type creation. - **Parent Epic**: #398 (Post-MVP Resources) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

Blocks
#398 Epic: Post-MVP Resources
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2401
No description provided.