Skip to content

feat(triggers): add integration validation system for agent execution#562

Merged
zbigniewsobiecki merged 1 commit intodevfrom
feature/integration-validation-system
Feb 26, 2026
Merged

feat(triggers): add integration validation system for agent execution#562
zbigniewsobiecki merged 1 commit intodevfrom
feature/integration-validation-system

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

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 integrations
    • getIntegrationRequirements(agentType) - returns required/optional integration categories
    • formatValidationErrors() - generates user-friendly error messages
  • Integration check functions

    • hasEmailIntegration(projectId) - checks email (IMAP/Gmail) integration
    • hasPmIntegration(projectId) - checks PM (Trello/JIRA) integration
    • hasScmIntegration(projectId) - checks SCM (GitHub) integration
    • hasScmPersonaToken(projectId, persona) - checks specific persona token
  • Agent definitions - added persona field (implementer/reviewer) for SCM token requirements

  • Entry point wiring - validation integrated into agent-execution.ts and manual-runner.ts

Agent Requirements by Type

Agent PM SCM Persona Email
implementation implementer -
splitting implementer -
planning implementer -
respond-to-review - implementer -
respond-to-ci - implementer -
respond-to-pr-comment - implementer -
respond-to-planning-comment - implementer -
review - reviewer -
debug - - -
email-joke - - -

Test Improvements

  • Integration tests - 45 tests covering PM, SCM, email, and persona validation
  • Unit tests - 10 tests for validation logic
  • Refactored with it.each() - consolidated 7 identical implementer agent tests
  • Standardized seed helpers - seedGitHubIntegration uses skipImplementer/skipReviewer pattern
  • Added Gmail credential tests - missing gmail_email and gmail_refresh_token
  • Consistent assertions - added array length checks before element access

Test plan

  • All 3355 unit tests pass
  • All 287 integration tests pass
  • TypeScript compilation passes
  • Lint checks pass
  • CI passes

🤖 Generated with Claude Code

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>
@zbigniewsobiecki zbigniewsobiecki merged commit 94c853d into dev Feb 26, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feature/integration-validation-system branch February 26, 2026 15:11
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.

1 participant