Skip to content

(bug) Removed provider connections still make agent runs ambiguous #5255

Description

@mmabrouk

When I remove the other Anthropic connections, configure a new agent with the remaining Anthropic connection, and run it, I expect Agenta to use that connection. Instead, the run fails because the backend still finds multiple Anthropic connections that are not visible as separate selectable connections in the UI.

Steps to reproduce:

  1. Configure an Anthropic provider key in the model and credentials drawer.
  2. Remove the other Anthropic connections shown in the UI.
  3. Create a new agent with the Claude harness, Anthropic model, and Daytona sandbox.
  4. Commit the revision and run the agent.

The run fails with:

multiple connections for provider 'anthropic'; name one in the config

The new agent revision saves this model configuration:

{
  "llm": {
    "provider": "anthropic",
    "model": "default",
    "connection": {
      "mode": "agenta"
    }
  }
}

A read-only GET /api/secrets/ request for the same project returns two Anthropic provider_key records, even after the duplicate connections were removed through the UI:

[
  {"name": "Anthropic", "kind": "provider_key", "provider_kind": "anthropic"},
  {"name": "Anthropic", "kind": "provider_key", "provider_kind": "anthropic"}
]

Reproduced on an EE development deployment with a newly created agent.

This blocks QA of #5244 because credential resolution fails before the Daytona sandbox is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BackendbugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions