Skip to content

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

Open
agent-relay-code[bot] wants to merge 1 commit into
mainfrom
factory/295-agentworkforce-workforce-e9e22830
Open

295: deploy/preflight: normalizeTriggerProviderAliases overwrites triggers when an alias collides with its canonical provider#297
agent-relay-code[bot] wants to merge 1 commit into
mainfrom
factory/295-agentworkforce-workforce-e9e22830

Conversation

@agent-relay-code

@agent-relay-code agent-relay-code Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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.

Fixes #295

Review in cubic

Copy link
Copy Markdown
Member

PR #297 is ready for human review at commit 0afa73f.

The alias normalization now appends colliding trigger lists instead of overwriting them, with an end-to-end regression covering google-mail plus gmail. Validation: @agentworkforce/deploy dependency-closure build passed, all 250 deploy tests passed, the focused collision test passed, and CI is green on this exact head. GitHub reports the PR mergeable with no conflicts, and there are no unresolved review threads.

Happy to discuss the behavior, validation, or any review questions before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant