Skip to content

feat(automation): Event Automations — IDE event-triggered AI agents (BETA)#980

Merged
stephanj merged 8 commits intomasterfrom
claude/research-cursor-automations-rhxHA
Mar 9, 2026
Merged

feat(automation): Event Automations — IDE event-triggered AI agents (BETA)#980
stephanj merged 8 commits intomasterfrom
claude/research-cursor-automations-rhxHA

Conversation

@stephanj
Copy link
Copy Markdown
Collaborator

@stephanj stephanj commented Mar 9, 2026

Summary

This PR introduces Event Automations, a feature that couples JetBrains IDE events (file open, file save, build failure, test failure, commit, process crash) with AI agent-triggered prompts. It was rebased onto master and promoted from POC to BETA after fixing substantive issues.

Changes

New Feature (from original branch)

  • Event Automation system: EventAutomationService dispatches IDE events to configured AI agents
  • IDE event listeners: File open/save, build success/failure, test pass/fail, process crash, VCS before-commit
  • Settings UI: Configurable event-agent mappings with enable/disable, custom prompts, and auto-run
  • Template engine: PromptTemplateRenderer supports {{context}}, {{content}}, {{files}}, {{event}}, {{timestamp}}, {{meta.KEY}} variables
  • Built-in agents: Code Review, Build Fix, Debug, Test Generator, Code Explainer, plus Custom agents

Bug Fixes (this PR)

  • P1 — Silent prompt loss: Event automations now ensure the DevoxxGenie tool window is initialized before dispatching prompts, preventing silent loss when the tool window hasn't been opened
  • P2 — Unsupported events: Removed 10 IdeEventType enum values (FILE_CREATED, METHOD_ADDED, GRADLE_SYNC, PROJECT_OPENED, etc.) and 3 AgentType entries (SCAFFOLDER, DEPENDENCY_CHECK, ONBOARDING) that had no backing listeners
  • P2 — Wrong project in tests: TestExecutionListener now uses the project-aware testSuiteFinished(root, project) overload instead of guessing via first open project
  • P2 — Missing staged diff: VcsCommitListener now reads ContentRevision.getContent() to include actual before/after file content, enabling line-level code review

Compilation Fixes (rebase)

  • PostStartupActivity: ExecutionListener.EXECUTION_TOPICExecutionManager.EXECUTION_TOPIC
  • EventAutomationService: Added missing tabId parameter to onPromptSubmitted()

Documentation & UI

  • Promoted POC → BETA across settings UI, plugin.xml, and Docusaurus docs
  • Added "More Info" help link to settings panel (links to documentation)
  • Rewrote Docusaurus page to reflect supported events/agents, added settings screenshot
  • Added FAQ entry about tool window auto-activation

Tests

  • IdeEventTypeTest: Validates enum values match wired listeners, catches future drift
  • EventAutomationSettingsTest: Validates default mappings, agent/event type integrity, boundary checks

Test Results

  • All 2494 tests pass (1 pre-existing flaky test OpenRouterChatModelFactoryTest.testConvertAndScalePrice fails only in full suite due to test ordering — passes in isolation, unrelated to this PR)
  • All 20 automation-specific tests pass

claude and others added 8 commits March 9, 2026 09:07
…red agents

Introduces a new settings panel where users can map IDE events (commit, build
failure, test failure, file open, etc.) to AI agents (Code Review, Debug, Build
Fix, Test Generator, etc.). Includes:

- IdeEventType enum: 18 IDE events across 7 categories (VCS, File, Build, Test,
  Code, Debug, Lifecycle)
- AgentType enum: 8 built-in agents + custom agent support, each with default prompts
- EventAgentMapping model: maps events to agents with enable/disable, auto-run,
  and custom prompt support
- EventAutomationSettings: container with default mappings factory
- Full settings UI: table with add/edit/remove, event/agent combo dialogs,
  "Load Defaults" button
- Registered as "Event Automations (POC)" under DevoxxGenie settings

This is a POC — the settings panel is fully functional but no actual IDE event
listeners are wired yet.

https://claude.ai/code/session_018rpBy4vkaYBD6t4aPq4tsQ
Comprehensive documentation covering:
- Overview of event-trigger → agent-action architecture
- All 18 supported IDE events organized by category
- 8 built-in agents with descriptions and example outputs
- Custom agent creation guide
- Default automations table
- Auto-run vs confirmation modes
- MCP integration possibilities
- Architecture overview and roadmap

https://claude.ai/code/session_018rpBy4vkaYBD6t4aPq4tsQ
…tomations

Implements the missing context-passing layer for the event automation POC:

- EventContext: structured model carrying runtime data (content, files, metadata)
  from IDE events to agent prompts
- PromptTemplateRenderer: resolves {{context}}, {{content}}, {{files}}, {{event}},
  {{timestamp}}, {{meta.KEY}} variables in prompt templates; falls back to appending
  the full context block when no variables are present
- EventAutomationService: central dispatch that checks enabled mappings, renders
  prompts with context, and either auto-submits or shows a confirmation notification
- IDE event listeners: BuildCompilationListener (BUILD_FAILED/SUCCEEDED),
  TestExecutionListener (TEST_FAILED/SUITE_PASSED), FileEventListener (FILE_OPENED),
  FileSaveListener (FILE_SAVED), VcsCheckinHandlerFactory + VcsCommitListener
  (BEFORE_COMMIT), ProcessExitListener (PROCESS_CRASHED)
- Updated AgentType default prompts to use {{context}}/{{files}}/{{meta.*}} variables
- Registered listeners in PostStartupActivity and plugin.xml
- Unit tests for EventContext and PromptTemplateRenderer

https://claude.ai/code/session_018rpBy4vkaYBD6t4aPq4tsQ
…tions

Add comprehensive documentation for the EventContext system that passes
rich context data to agents triggered by IDE events. Covers template
variables ({{context}}, {{content}}, {{files}}, {{event}}, {{timestamp}},
{{meta.KEY}}), per-event metadata reference tables, context block format,
example prompts, and fallback behavior. Also updates roadmap to reflect
that event listeners and context injection are now implemented.

https://claude.ai/code/session_018rpBy4vkaYBD6t4aPq4tsQ
- PostStartupActivity: use ExecutionManager.EXECUTION_TOPIC instead of
  non-existent ExecutionListener.EXECUTION_TOPIC
- EventAutomationService: add missing third tabId argument to
  onPromptSubmitted() after PromptSubmissionListener signature change
P2: Remove 10 unsupported IdeEventType enum values (FILE_CREATED,
METHOD_ADDED, GRADLE_SYNC, PROJECT_OPENED, etc.) and their corresponding
AgentType entries (SCAFFOLDER, DEPENDENCY_CHECK, ONBOARDING) that had no
backing listeners. Remove default mappings referencing them.

P2: TestExecutionListener now overrides the project-aware
testSuiteFinished(root, project) method instead of guessing the project
via findActiveProject(), fixing incorrect project resolution in
multi-project sessions.

P2: VcsCommitListener now reads ContentRevision.getContent() to include
actual before/after file content in the staged diff, enabling the
code-review agent to perform line-level review as advertised.
- Rename (POC) to (BETA) in settings UI, plugin.xml, and docs
- Add 'More Info' help link to settings panel via getHelpUrl() override
- Rewrite Docusaurus page to reflect current supported events, agents,
  and default mappings; add settings screenshot; update Before Commit
  docs to describe staged diff content; add tool-window FAQ entry
- IdeEventTypeTest: validates enum values match wired listeners, checks
  display names/descriptions/categories to catch future drift
- EventAutomationSettingsTest: validates default mappings only reference
  supported event and agent types, all disabled by default, boundary
  checks for add/remove/getMapping
- Add backlog TASK-202 tracking the rebase and fixes
@stephanj stephanj merged commit 31b3d28 into master Mar 9, 2026
7 of 9 checks passed
@stephanj stephanj deleted the claude/research-cursor-automations-rhxHA branch March 9, 2026 08:58
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.

2 participants