Skip to content

deploy/preflight: normalizeTriggerProviderAliases overwrites triggers when an alias collides with its canonical provider #295

Description

@kjgbot

Where

packages/deploy/src/preflight.tsnormalizeTriggerProviderAliases()

const normalized: NonNullable<AgentSpec['triggers']> = {};
for (const [provider, list] of Object.entries(triggers)) {
  normalized[aliases[provider] ?? provider] = list;
}

Problem

If an agent declares triggers under both an alias and its canonical name (e.g. google-mail and gmail), both keys normalize to gmail and the second assignment overwrites the first — silently dropping a set of triggers. Assignment should merge the lists.

Suggested fix

const key = aliases[provider] ?? provider;
normalized[key] = [...(normalized[key] ?? []), ...list];

Edge case (an agent is unlikely to declare both), but the failure is silent — dropped triggers never register and never fire.


Found by CodeRabbit while reviewing the vendored snapshot of this file in AgentWorkforce/skills#87.

Metadata

Metadata

Assignees

No one assigned

    Labels

    factory-readyReady for autonomous factory/agent pickup

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions