Skip to content

(bug) Pi rejects every custom-provider connection before the run starts #5114

Description

@mmabrouk

When a custom-provider connection is selected as the model for the pi_core harness and a run is triggered, the run is rejected before the agent starts — for every custom provider, including the one the error message itself recommends.

Steps to reproduce

  1. In the connections drawer, add a custom provider connection with a provider-family kind (for example an OpenAI-compatible key, data.kind = "openai").
  2. In the agent config, pick that connection's model for harness pi_core.
  3. Trigger a run (/run on the agent service, or a run from the playground).

Observed

deployment 'openai' is not supported by harness 'pi_core' in v1

The error suggests switching to the OpenAI-compatible custom connection instead — but selecting that connection (data.kind = "custom") produces the same rejection, because "custom" isn't "direct" either.

The frontend model dropdown still lists these models under Pi, so nothing in the UI warns the user before they hit this.

Where this lives

  • sdks/python/agenta/sdk/agents/platform/connections.py_custom_provider_candidate sets deployment = data.get("kind") for every custom-provider candidate, so provider-family kinds (openai, openrouter, ...) end up as literal deployment values, indistinguishable from real deployment kinds (azure, bedrock, vertex_ai, custom).
  • sdks/python/agenta/sdk/agents/capabilities.pyHARNESS_CONNECTION_CAPABILITIES["pi_core"].deployments only allows ["direct"].
  • services/oss/src/agent/app.py_check_harness_post_resolve is the gate that raises UnsupportedDeploymentError, producing the message above.
  • The frontend already distinguishes provider-family kinds from real deployment kinds via DEPLOYMENT_KINDS in web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/connectionUtils.ts (around lines 344-373). The backend has no equivalent classification.

Suggested fix: normalize provider-family kinds to deployment="direct" inside _custom_provider_candidate, sharing the frontend's deployment-kind classification as the single source of truth for what counts as a deployment vs. a plain provider family.

Context

Found while probing custom-provider connections end to end against the dev stack (2026-07-07). Surfaced by the new connect-model drawer in #5096, which now actively offers these custom-provider paths to users. Related: this is one of five connection gaps found in the same investigation — see also the Claude-side and resolution-ranking issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions