Skip to content

Decision: should one failing source fail a sync run? #4994

Open

Description

@yannickmonney

Summary

Tale's syncs succeed while at least one of their sources succeeds. A source that fails on every run, such as one repository whose token was revoked, therefore never reaches a schedule's failure accounting or its failure notices. The only trace is that source's receipt in each run's output. A first consumer, the Ops fleet's intake, needs "one failed source fails the run" and will build it with a condition node on the receipt. Should Tale offer this, and how?

What the repo says today (main at 9179c16)

Three rules make the same choice:

  • Issue sync: services/platform/backend/domains/tasks/spec.md:727 (TASK-R54): "An issue sync fails only when every one of its sources failed". While some sources succeed, the step succeeds and the failed sources' errors stay in their receipts. The reason is stated at services/platform/lib/connectors/natives/issue-sync.ts:18-20: "so a schedule's failure streak and its notifications speak for a sync that is broken, not for one tracker that is down".
  • Mail sync: services/platform/backend/domains/conversations/spec.md:201 (CONV-R21): one failing mailbox does not stop the others; only when every mailbox fails does the run fail, "so the automation's failure notices go out".
  • Loops: services/platform/backend/domains/automations/spec.md:724 (AUTO-R70): with onItemError: continue, a step fails only if every item failed.

What the step answers (issue-sync.ts:388-396): sources (one receipt per source, with ok, error, message, status, …), failed (sources whose batch failed), rateLimited, created, refreshed.

The platform already counts a source's consecutive failures for another purpose. Per TASK-R59 (tasks/spec.md:782), a position whose batch the tracker refuses three times in a row starts its pass over. No rule surfaces that count to a person.

What was observed

  • No incident: the gap was found while designing the Ops fleet's intake (one sync over Tale's GitHub repositories and GlitchTip projects). One dead source among three would never fail a run, so the schedule's failure accounting would never see it.
  • Workaround available today without a Tale change: a condition step after the sync that fails the run when failed > 0. The Ops intake will do this.

Not examined: whether the automation's Problems view or a run's list row shows "succeeded, 1 source failed" anywhere today. Also not examined: how often a single source fails for long in practice.

Constraints

  • A tracker that is down for an hour should not page anyone. That was the reason for TASK-R54 and CONV-R21.
  • A rate-limited source has not failed (TASK-R56), and any change must keep that.
  • Installed automations rely on today's behaviour, so a change of default changes their failure notices.

Options

  1. A step option, for example failWhen: any | all on task.sync_issues (and the mail sync), defaulting to all. Explicit, per automation, and the template can choose.
  2. A degraded outcome: the run succeeds "with problems". Failure accounting stays as it is, but a separate notice goes out when a source has failed N runs in a row, reusing the position's failure count from TASK-R59.
  3. Document the recipe: keep the rules and show the condition step on failed in the templates and docs (works today).
  4. Health per source: show each source's consecutive failures on the automation (Problems or overview), without changing any run's outcome.

Questions

  • Should a single dead source page someone, and after how many runs?
  • Should one choice hold for issue sync, mail sync and onItemError: continue alike?

Related

Activity

  1. added
    needs discussion
    service: platform
    on Oct 15, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    Decision

    Rule: A sync run still fails only when every one of its sources failed, as TASK-R54 and CONV-R21 say today. A source that keeps failing is reported through its own health record, not through the run's outcome:

    • The platform keeps a streak of failed live runs for each source of each installed sync step.
    • Causes the next run would repeat (credential, unauthorized, not_found, invalid_response, failed) add to the streak.
    • An outage (unavailable) or a rate limit neither adds to the streak nor resets it. A success resets it to zero.
    • Mail sync gains these same classes, so an unreachable mail server counts as an outage and not as a failure.
    • At the 5th failed run in a row, a notice (automation_source_failing, in the automation alerts preference) goes to the organization's owners and admins. Each automation installation gets one card, listing every failing source with its error. A streak notifies once. The card is marked read when every source it lists has recovered or been removed.
    • A source removed from the step's config, or whose filter was changed, drops out of health.
    • Nothing is paused and no run changes outcome. The automation's overview lists the failing sources.

    failOn: any stays on task.sync_issues (TASK-R77) as a strict opt-in, and conversation.sync_mailbox gets the same option. onItemError: continue loops (AUTO-R70) are unchanged.

    Answers

    • Should a single dead source page someone, and after how many runs? Yes, after 5 live runs in a row that fail for a cause that would repeat. That is the same threshold as a schedule's own pause (AUTO-R13). An outage or a rate limit never counts, so a tracker or mail server that is down for an hour pages nobody.
    • Should one choice hold for issue sync, mail sync and loops alike? Issue sync and mail sync: yes. They share the default, the failOn option, the error classes and source health. Loops: no. Their items have no identity across runs, so a streak means nothing for them. AUTO-R70 stays.

    Rationale

    Flipping the default would change installed automations' failure accounting and would page during short outages. failOn: any on its own has a hazard: five failed runs pause the whole schedule, so one revoked token would stop the healthy sources too. Keeping health per source, apart from the run's outcome, makes a dead source visible within a bounded number of runs without hurting anything else. That only works if both syncs can tell an outage from a lasting fault. Mail sync currently files every mailbox failure as a plain failure, so it is classified first. The TASK-R59 position count cannot do this job: it resets after three refusals and counts batches, not runs.

    Implementation units (all on main)

    1. failOn: all|any on the mail sync step: a new CONV rule, docs in en/de/fr, tests (S).
    2. Mail sync failures classified like issue sources, so outages are told apart (S).
    3. A failure streak per source for sync steps: a table, outcomes reported by the step, pruning of removed sources, a new AUTO rule, issue and mail sync wired in (M; needs 2).
    4. A notice when a source has failed five runs in a row: a new notification type, one card per installation, marked read on recovery, locales (M; needs 3).
    5. Failing sources shown on the automation overview: endpoint, accessible design-system section, verified in a browser (M; needs 3).
    6. Docs: when to use failOn: any versus source health, including the schedule-pause warning (S; needs 1 and 4).

    Cross-issue amendments (decisions taken together with #4946):

  3. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyimprovementservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions