diff --git a/plugins/agent-workbench/ai-review/resources/intellij.agent.workbench.ai.review.xml b/plugins/agent-workbench/ai-review/resources/intellij.agent.workbench.ai.review.xml index 3b0363a4bab0..7ead90210e1e 100644 --- a/plugins/agent-workbench/ai-review/resources/intellij.agent.workbench.ai.review.xml +++ b/plugins/agent-workbench/ai-review/resources/intellij.agent.workbench.ai.review.xml @@ -15,8 +15,6 @@ - = listOf( + CLAUDE_AGENT_SESSION_PROVIDER, + CODEX_AGENT_SESSION_PROVIDER, + JUNIE_AGENT_SESSION_PROVIDER, + OPENCODE_AGENT_SESSION_PROVIDER, +) diff --git a/plugins/agent-workbench/ai-review/src/com/intellij/agent/workbench/ai/review/AIReviewCollector.kt b/plugins/agent-workbench/ai-review/src/com/intellij/agent/workbench/ai/review/AIReviewCollector.kt index f7ae4ba48497..035dd780b239 100644 --- a/plugins/agent-workbench/ai-review/src/com/intellij/agent/workbench/ai/review/AIReviewCollector.kt +++ b/plugins/agent-workbench/ai-review/src/com/intellij/agent/workbench/ai/review/AIReviewCollector.kt @@ -7,7 +7,6 @@ import com.intellij.agent.workbench.ai.review.model.ReviewRating import com.intellij.internal.statistic.StructuredIdeActivity import com.intellij.internal.statistic.eventLog.EventLogGroup import com.intellij.internal.statistic.eventLog.events.EventFields -import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector import com.intellij.lang.LanguageUtil import com.intellij.openapi.diagnostic.fileLogger @@ -15,12 +14,9 @@ import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.project.Project import com.intellij.openapi.vcs.VcsException import com.intellij.openapi.vcs.changes.Change -import com.intellij.platform.ai.agent.core.session.AgentSessionProvider -import com.jetbrains.fus.reporting.api.IEventContext -import com.jetbrains.fus.reporting.api.ValidationResultType internal object AIReviewCollector : CounterUsagesCollector() { - private val group = EventLogGroup("agent.workbench.ai.review", 5) + private val group = EventLogGroup("agent.workbench.ai.review", 6) private val REQUEST_ID = EventFields.Long("request_id", "ID of the review request.") private val RATING = EventFields.Enum("rating", ReviewRating::class.java) @@ -49,7 +45,7 @@ internal object AIReviewCollector : CounterUsagesCollector() { private val SUCCESS = EventFields.Boolean("success") - private val AGENT = EventFields.StringValidatedByCustomRule("agent") + private val AGENT = EventFields.String("agent", AVAILABLE_AI_REVIEW_AGENT_PROVIDERS.map { it.value }) private val YOLO = EventFields.Boolean("yolo", "Whether the agent was launched in YOLO (skip-permissions / full-auto) mode.") private data class ChangeMetrics( @@ -239,13 +235,4 @@ internal object AIReviewCollector : CounterUsagesCollector() { charsRemoved = charsRemoved, ) } - -} - -internal class AIReviewAgentProviderValidationRule : CustomValidationRule() { - override fun doValidate(data: String, context: IEventContext): ValidationResultType { - return if (AgentSessionProvider.fromOrNull(data) != null) ValidationResultType.ACCEPTED else ValidationResultType.REJECTED - } - - override fun getRuleId(): String = "agent_workbench_ai_review_provider" } \ No newline at end of file