Skip to content

Interrupting deploy --wait does not prevent duplicate deployments #337

@timflannagan

Description

@timflannagan

If arctl agent deploy --wait or arctl mcp deploy --wait is interrupted with Ctrl+C, the CLI stops waiting locally
but the server-side deployment may continue.

Re-running the same deploy can then create a second managed deployment instead of resuming, observing, or
replacing the existing one. This is especially risky when the original deployment is still recoverable after the
underlying issue is fixed.

Reproducer:

  1. Start a deploy and interrupt it while waiting:
ARCTL_API_BASE_URL=http://127.0.0.1:12121 \
  ./bin/arctl agent deploy testagent --version latest \
  --provider-id kubernetes-default

Then press Ctrl+C.

  1. Run the same deploy again:
ARCTL_API_BASE_URL=http://127.0.0.1:12121 \
  ./bin/arctl agent deploy testagent --version latest \
  --provider-id kubernetes-default
  1. Verify duplicate managed deployments now exist:
kubectl -n agentregistry exec deploy/agentregistry -- \
  curl -sS http://127.0.0.1:8080/v0/deployments | jq '
    .deployments[]
    | select(.resourceType=="agent" and .serverName=="testagent")
    | {id,version,status,providerId,error,updatedAt}
  '
  1. Verify duplicate Kubernetes Agent CRs exist:
kubectl get agents -A -o json | jq '
  .items[]
  | select(.metadata.name|startswith("testagent-latest"))
  | {
      name: .metadata.name,
      deploymentId: (.metadata.labels["aregistry.ai/deployment-id"] // ""),
      conditions: (.status.conditions // [])
    }
'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions