UAT: agents resource stop rejects container-instance type — spec requires stop to work for both devcontainer-instance and container-instance #2114

Open
opened 2026-04-03 04:11:24 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/container-instance-stop-support
  • Commit Message: fix(resource): wire container-instance stop support per spec
  • Milestone: v3.7.0
  • Parent Epic: #825

Bug Report

What Was Tested

The agents resource stop CLI command behavior for container-instance resources.

Expected Behavior (from spec)

Per docs/specification.md line 12022:

Stop an active devcontainer-instance or container-instance resource. Transitions the container through running → stopping → stopped. Only container-typed resources may be stopped; attempting to stop other resource types produces an error.

The spec explicitly states that agents resource stop should work for both devcontainer-instance and container-instance resource types.

Actual Behavior (from code)

In src/cleveragents/cli/commands/resource.py lines 1354-1394:

# F19 fix: restricted to devcontainer-instance only — container-instance
# has no lifecycle tracker wiring, so stop/rebuild would fail at runtime.
_STOPPABLE_TYPES = frozenset({"devcontainer-instance"})

When a user attempts to stop a container-instance resource, the CLI rejects it with:

Resource 'local/my-ctr' is type 'container-instance', not a stoppable container type.

Root Cause

The code comment explains the rationale: container-instance has no lifecycle tracker wiring. However, this is a spec violation — the spec requires container-instance to be stoppable. The fix should either:

  1. Wire lifecycle tracker support for container-instance resources, OR
  2. Update the spec to reflect that only devcontainer-instance is stoppable via this CLI command

Since the spec is the source of truth, the code must be updated to support container-instance stop.

Code Location

  • src/cleveragents/cli/commands/resource.py, line 1354: _STOPPABLE_TYPES = frozenset({"devcontainer-instance"})
  • src/cleveragents/cli/commands/resource.py, line 1391-1396: type check that rejects container-instance

Steps to Reproduce

  1. Register a container-instance resource: agents resource add container-instance local/my-ctr --image ubuntu:latest
  2. Attempt to stop it: agents resource stop local/my-ctr
  3. Observe: CLI rejects with "not a stoppable container type" error

Severity

High — This is a direct spec violation for a documented CLI command. Users following the spec documentation will be unable to stop container-instance resources.

Subtasks

  • Wire ContainerLifecycleTracker support for container-instance resources
  • Update _STOPPABLE_TYPES to include container-instance
  • Add unit tests for stopping container-instance via CLI (Behave/BDD in features/)
  • Add integration test for agents resource stop with container-instance (Robot Framework in robot/)

Definition of Done

  • agents resource stop successfully stops a running container-instance resource
  • agents resource stop still works for devcontainer-instance resources
  • Unit tests written in Behave BDD style (features/) pass
  • Integration tests written in Robot Framework (robot/) pass
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/container-instance-stop-support` - **Commit Message**: `fix(resource): wire container-instance stop support per spec` - **Milestone**: v3.7.0 - **Parent Epic**: #825 ## Bug Report ### What Was Tested The `agents resource stop` CLI command behavior for `container-instance` resources. ### Expected Behavior (from spec) Per `docs/specification.md` line 12022: > Stop an active `devcontainer-instance` **or `container-instance`** resource. Transitions the container through `running → stopping → stopped`. Only container-typed resources may be stopped; attempting to stop other resource types produces an error. The spec explicitly states that `agents resource stop` should work for **both** `devcontainer-instance` and `container-instance` resource types. ### Actual Behavior (from code) In `src/cleveragents/cli/commands/resource.py` lines 1354-1394: ```python # F19 fix: restricted to devcontainer-instance only — container-instance # has no lifecycle tracker wiring, so stop/rebuild would fail at runtime. _STOPPABLE_TYPES = frozenset({"devcontainer-instance"}) ``` When a user attempts to stop a `container-instance` resource, the CLI rejects it with: ``` Resource 'local/my-ctr' is type 'container-instance', not a stoppable container type. ``` ### Root Cause The code comment explains the rationale: `container-instance` has no lifecycle tracker wiring. However, this is a spec violation — the spec requires `container-instance` to be stoppable. The fix should either: 1. Wire lifecycle tracker support for `container-instance` resources, OR 2. Update the spec to reflect that only `devcontainer-instance` is stoppable via this CLI command Since the spec is the source of truth, the code must be updated to support `container-instance` stop. ### Code Location - `src/cleveragents/cli/commands/resource.py`, line 1354: `_STOPPABLE_TYPES = frozenset({"devcontainer-instance"})` - `src/cleveragents/cli/commands/resource.py`, line 1391-1396: type check that rejects `container-instance` ### Steps to Reproduce 1. Register a `container-instance` resource: `agents resource add container-instance local/my-ctr --image ubuntu:latest` 2. Attempt to stop it: `agents resource stop local/my-ctr` 3. Observe: CLI rejects with "not a stoppable container type" error ### Severity **High** — This is a direct spec violation for a documented CLI command. Users following the spec documentation will be unable to stop `container-instance` resources. ## Subtasks - [ ] Wire `ContainerLifecycleTracker` support for `container-instance` resources - [ ] Update `_STOPPABLE_TYPES` to include `container-instance` - [ ] Add unit tests for stopping `container-instance` via CLI (Behave/BDD in `features/`) - [ ] Add integration test for `agents resource stop` with `container-instance` (Robot Framework in `robot/`) ## Definition of Done - [ ] `agents resource stop` successfully stops a running `container-instance` resource - [ ] `agents resource stop` still works for `devcontainer-instance` resources - [ ] Unit tests written in Behave BDD style (`features/`) pass - [ ] Integration tests written in Robot Framework (`robot/`) pass - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:11:28 +00:00
freemo self-assigned this 2026-04-03 16:58:05 +00:00
Author
Owner

MoSCoW classification: Should Have

Rationale: This issue addresses a spec requirement or important quality improvement. It should be included in the milestone if possible.


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

MoSCoW classification: **Should Have** Rationale: This issue addresses a spec requirement or important quality improvement. It should be included in the milestone if possible. --- **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
Reference
cleveragents/cleveragents-core#2114
No description provided.