Skip to content

(bug) A self_managed connection carrying a slug returns HTTP 500 instead of 422 #5641

Description

@mmabrouk

When I send an agent run whose connection is {"mode": "self_managed", "slug": "..."}, the request fails with HTTP 500. The validator that rejects the combination (Connection._reject_slug_for_self_managed in sdks/python/agenta/sdk/agents/connections/models.py) raises during request handling and surfaces as an internal error, while the sibling capability rejection for an unsupported provider correctly returns 422.

Steps to reproduce:

  1. POST an agent run with connection: {"mode": "self_managed", "slug": "anything"}.
  2. Response: 500 with the validator's message, instead of a 422 validation response.

A client input error should never surface as a 500. Seen on staging (v0.107.0) during release QA, 2026-08-01; the validator predates this release (landed 2026-06-24).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions