Skip to content

feat(sdk): distinguish 'unreachable' from 'reachable but not serving' in WithConnectionValidation #3413

@marythought

Description

@marythought

Context

In sdk/sdk.go, validateHealthyPlatformConnection returns ErrPlatformUnreachable in two distinct cases:

  1. Transport failure (the platform is genuinely unreachable)
  2. The platform is reachable but reports a non-SERVING status (NOT_SERVING / UNKNOWN)

This conflation makes debugging harder for SDK consumers — case 2 means "the platform is up but not ready" which is a fundamentally different operational signal.

Surfaced in #3412 (gemini-code-assist review).

Proposal

Introduce ErrPlatformNotHealthy and return it from case 2; reserve ErrPlatformUnreachable for transport failures only.

Caveat

This is a behavior change — callers of WithConnectionValidation that branch on the existing error will need to update. Consider a deprecation cycle or doc note.

Acceptance

  • ErrPlatformNotHealthy defined and documented
  • validateHealthyPlatformConnection returns it for non-SERVING reachable platforms
  • Tests covering both error paths
  • Migration note in CHANGELOG

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions