Skip to content

Chat: select deployments by active replica traffic status via nested replica filter (FR-3303 follow-up) #8297

Description

@agatha197

Background

Follow-up to FR-3303. That bug fixed the Playground Chat endpoint selector hiding a deployment while a new revision rolls out (a prior revision's replica is still serving). The interim fix filters the legacy endpoint_list connection by endpoint-level lifecycle_stage (lifecycle_stage != "destroyed" & lifecycle_stage != "destroying"), which is a proxy signal — it keeps non-terminated deployments visible but does not truly check whether a replica is serving traffic.

Per the originating discussion, the clean signal is the replica traffic status: a deployment should be chat-selectable when it has at least one replica whose traffic status is ACTIVE. This was blocked on the endpoint/deployment connection lacking nested filters.

That backend capability is now available: backend.ai #12805 (BA-6849) "support nested replica deployment filters" (manager 26.8.0). It adds DeploymentFilter.replicas: ReplicaNestedFilter { some | every | none: ReplicaFilter }, and ReplicaFilter.trafficStatus: TrafficStatusFilter with enum TrafficStatus { ACTIVE, INACTIVE }.

Goal

Replace the interim lifecycle_stage-based filtering in the Chat endpoint selection with the nested replica traffic-status filter, so a deployment is selectable precisely when a replica is actively serving.

Target filter (on the myDeployments connection):

filter: { replicas: { some: { trafficStatus: { equals: ACTIVE } } } }

Scope

  • react/src/pages/ChatPage.tsxuseDefaultEndpointId (currently queries endpoint_list with a string lifecycle_stage filter).
  • react/src/components/Chat/EndpointSelect.tsx — the Chat endpoint dropdown (currently queries endpoint_list with a string lifecycle_stage filter).

Both carry a TODO(FR-3303) marker pointing at this work.

Implementation notes

  • The nested replicas filter lives on the structured DeploymentFilter input of the deployments connections (myDeployments / projectDeployments / adminDeployments), not on the legacy endpoint_list string-filter field. So this requires migrating the two Chat queries from endpoint_list to myDeployments (user-scoped), following the existing BAIDeploymentSelect / DeploymentListPage patterns.
  • DeploymentFilter.replicas ships in manager 26.8.0, so it must be version-gated (isManagerVersionCompatibleWith('26.8.0')). On older managers, fall back to the interim behavior (exclude terminated deployments) so nothing regresses.
  • Requires syncing data/schema.graphql to include input ReplicaNestedFilter and DeploymentFilter.replicas, then pnpm relay.

Verification

  • bash scripts/verify.sh (Relay + Lint + Format + TypeScript).
  • Live verification against a 26.8.0 manager is pending the manager release; until then the change ships behind the version gate.

JIRA Issue: FR-3332

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions