feat(triggers): add integration validation system for agent execution#562
Merged
zbigniewsobiecki merged 1 commit intodevfrom Feb 26, 2026
Merged
Conversation
Add pre-flight validation of project integrations before agent execution. This catches misconfiguration early with clear, actionable error messages pointing users to the dashboard settings. Key changes: - Add validateIntegrations() to check PM, SCM, and email integrations - Add persona-aware SCM validation (implementer vs reviewer tokens) - Add hasEmailIntegration(), hasPmIntegration(), hasScmIntegration() checks - Add persona field to agent definitions for SCM token requirements - Wire validation into agent-execution and manual-runner entry points Agent requirements by type: - implementation, splitting, planning: PM + SCM (implementer) - respond-to-review, respond-to-ci, respond-to-pr-comment: SCM (implementer) - review: SCM (reviewer) - debug: PM only - email-joke: email only Test improvements: - Add comprehensive integration tests (45 tests) - Add unit tests for validation logic (10 tests) - Refactor implementer agent tests using it.each() - Standardize seedGitHubIntegration helper options to skip* pattern - Add Gmail credential tests and empty value edge case - Add consistent array length checks before element access Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add pre-flight validation of project integrations before agent execution. This catches misconfiguration early with clear, actionable error messages pointing users to the dashboard settings.
Key Changes
Integration validation module (
src/triggers/shared/integration-validation.ts)validateIntegrations(projectId, agentType)- validates all required integrationsgetIntegrationRequirements(agentType)- returns required/optional integration categoriesformatValidationErrors()- generates user-friendly error messagesIntegration check functions
hasEmailIntegration(projectId)- checks email (IMAP/Gmail) integrationhasPmIntegration(projectId)- checks PM (Trello/JIRA) integrationhasScmIntegration(projectId)- checks SCM (GitHub) integrationhasScmPersonaToken(projectId, persona)- checks specific persona tokenAgent definitions - added
personafield (implementer/reviewer) for SCM token requirementsEntry point wiring - validation integrated into
agent-execution.tsandmanual-runner.tsAgent Requirements by Type
Test Improvements
seedGitHubIntegrationusesskipImplementer/skipReviewerpatterngmail_emailandgmail_refresh_tokenTest plan
🤖 Generated with Claude Code