refactor(agents): move contextPipeline from strategies to triggers#601
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 2, 2026
Merged
Conversation
This refactoring moves context pipeline configuration from a global default in `strategies.contextPipeline` to trigger-specific definitions. This provides more explicit control over what context each trigger fetches. ## Changes ### Schema (`schema.ts`) - Remove `contextPipeline` from `StrategiesSchema` - Update comment to clarify context step names are only used by triggers - Update JSDoc for `contextPipeline` in `SupportedTriggerSchema` ### Profile Resolution (`profiles.ts`) - Simplify `resolveContextPipeline()` to only use trigger-defined pipelines - Return empty array when no trigger matches (no default fallback) - Add comprehensive JSDoc documenting edge cases ### Agent Definitions (YAML) - Move `contextPipeline` from `strategies` to each trigger definition - `strategies` now only contains `gadgetOptions` (or empty object) - Fix respond-to-review.yaml taskPrompt (was copy-pasted from respond-to-pr-comment) - Add missing `trailingMessage` to respond-to-pr-comment.yaml for consistency ### API Router - Remove `contextStepNames` from schema endpoint (no longer needed by frontend) ### Dashboard UI - Remove context pipeline editor from strategies section - Strategies section now only shows gadgetOptions when present - Clean up unused schema data ### Tests - Update loader tests to use trigger-defined pipelines - Update schema tests to remove strategies.contextPipeline assertions - Add edge case tests for resolveContextPipeline: - Returns empty array when triggerType is undefined - Returns empty array when triggerType matches no trigger - Returns empty array for agents with no triggers (debug) - Returns empty array when triggerType is empty string ## Benefits 1. **Explicit context per trigger**: Each trigger clearly defines what context it needs, making the configuration more transparent 2. **No hidden defaults**: Removed the fallback behavior that could mask misconfiguration 3. **Simpler mental model**: One place to look for context configuration 4. **Better for review agents**: SCM-triggered agents don't accidentally fetch PM context they don't need 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
strategies.contextPipelineto trigger-specific definitionsrespond-to-review.yamltaskPrompttrailingMessagetorespond-to-pr-comment.yamlfor consistencyChanges
Schema & Logic
contextPipelinefromStrategiesSchema(now trigger-only)resolveContextPipeline()to return[]when no trigger matchesAgent Definitions
contextPipelineper-trigger instead of instrategiesrespond-to-review.yamltaskPrompt (was incorrectly copy-pasted from respond-to-pr-comment)trailingMessagetorespond-to-pr-comment.yamlAPI & UI
contextStepNamesfrom schema endpoint (frontend no longer needs it)Tests
resolveContextPipeline:triggerType: undefined→[]triggerType→[][]triggerType→[]Benefits
Test plan
npm run typecheckpassesnpm run lintpassesnpm testpasses (3726 tests)🤖 Generated with Claude Code