Skip to content

fix(platform): carry the vendor's status on every live body's error #5277

Closed

Description

@tale-code-bot

Part of #5274, split off while working on it (task TALE-367).

Defect. A run classifies a failed live connector call by the HTTP status its error carries (connectorFailureOf in services/platform/lib/engine/core/record/failure.ts): a 429 or a 5xx is connector_unavailable, which never counts toward pausing a schedule (AUTO-R13). The fix for #5274 (branch fix/live-connector-vendor-status, in review) has the dispatcher keep the status a yaml-js body's error carries (LIVE_BODY_FAILED gains status), and makes Slack's bodies throw with that status. Every other shipped yaml-js live body still throws a plain new Error(...) when the vendor's answer fails. So a vendor's 429 or 5xx there is still classified CONNECTOR_FAILED in the connector_error family, which counts toward pausing a schedule.

These connectors' live bodies throw on a failed answer without its status, checked at train 5f71a27756048345381bee084033867de09e492f (configs/platform/system/connectors/<slug>/connector.yml):

  • confluence
  • discord
  • forgejo
  • github
  • gmail
  • google-drive
  • jev
  • outlook (the error builder in its livePrelude)
  • shopify
  • tavily
  • teams
  • twilio

Asked. Every body that throws because of the vendor's answer throws with that answer's status: throw Object.assign(new Error(message), { status: r.status }) (a prelude helper may build it). A body's own refusal of a 2xx answer stays without a status.

Depends on the fix for #5274 reaching train: until then the dispatcher drops the status.

Regression test: for each connector, a live call the vendor answered 429 fails as LIVE_BODY_FAILED with status: 429 (see the Slack case in services/platform/lib/connectors/dispatcher.test.ts), which a run classifies as CONNECTOR_RATE_LIMITED in the connector_unavailable family.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions