Skip to content

bug: #898

@papillonlibre

Description

@papillonlibre

Agent Diagnostic

Skills loaded: openshell-cli, create-spike, create-github-issue

Traced the full call chain:

main.rs:1738-1746run::gateway_admin_destroyopenshell_bootstrap::gateway_handle + handle.destroy()
destroy_gateway_resources in crates/openshell-bootstrap/src/docker.rs:911.

destroy_gateway_resources is intentionally idempotent: every Docker "not found"
error is explicitly treated as Ok(()):

  • Container: docker.rs:950-953if !is_not_found(&err) { return Err(...) }
  • Volume: docker.rs:1004-1007 — same pattern
  • Network: docker.rs:1070force_remove_network returns Ok(()) immediately on not-found

The function returns Ok(()) whether it destroyed resources or found nothing.
gateway_admin_destroy in run.rs:1648 then unconditionally prints
✓ Gateway {name} destroyed. with no signal from the callee about whether
anything was actually present.

No existing check guards the success message path. check_existing_deployment()
exists in openshell-bootstrap and would detect this, but is not called here.

Complexity: Low (~2 files, isolated change).

Description

Actual behavior: openshell gateway destroy prints:

• Destroying gateway openshell...
✓ Gateway openshell destroyed.

every time it is run, including when no gateway container, volume, or network
exists. Running it N times always reports N successful destructions.

Expected behavior: When no gateway resources are found, the command should
report that there was nothing to destroy (e.g., No gateway 'openshell' found.)
rather than falsely claiming a successful destruction. This makes it impossible
to tell from the output whether a gateway was actually present and removed.

Reproduction Steps

  1. Deploy a gateway: openshell gateway start
  2. Destroy it: openshell gateway destroy — expected success
  3. Run again: openshell gateway destroy — falsely reports success with no gateway present
  4. Repeat step 3 any number of times — always "succeeds"

Environment

  • OS: Linux (Ubuntu, NVIDIA DGX)
  • Docker: (running)
  • OpenShell: 0.0.33

Logs

(base) nvidia@localhost:~$ openshell gateway destroy
  • Destroying gateway openshell...
  ✓ Gateway openshell destroyed.

  (base) nvidia@localhost:~$ openshell gateway destroy
  • Destroying gateway openshell...
  ✓ Gateway openshell destroyed.

Agent-First Checklist

  • I pointed my agent at the repo and had it investigate this issue
  • I loaded relevant skills (e.g., debug-openshell-cluster, debug-inference, openshell-cli)
  • My agent could not resolve this — the diagnostic above explains why

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions