NotificationManager: assertion error removing selection listener on editor change

Status Closed — duplicate
Maintainer reply None cached
Activity 3 comments · opened Jun 3, 2026 · closed Jun 6, 2026

When switching files in the IntelliJ editor, the Claude Code plugin throws an assertion error because NotificationManager attempts to remove a selection listener that no longer matches the registered listener instance (identity comparison fails).

Error:

Assertion failed: Failed to remove listener: com.anthropic.code.plugin.mcp.notifications.NotificationManager$registerSelectionListener$selectionListener$1@17959aa
from editor: EditorImpl[file:///.../KafkaServiceSecondarytoVirtualKafkaClusterPrimaryMapperTest.java]

Stack trace:

java.lang.Throwable: Assertion failed: Failed to remove listener...
    at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:474)
    at com.intellij.openapi.editor.impl.SelectionModelImpl.removeSelectionListener(SelectionModelImpl.java:131)
    at com.anthropic.code.plugin.mcp.notifications.NotificationManager$registerSelectionListener$2.selectionChanged(NotificationManager.kt:92)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.fireSelectionChanged(FileEditorManagerImpl.kt:1915)
    ...

Root cause: The listener registered via registerSelectionListener and the one stored for removal are different lambda instances, so removeSelectionListener can't find a match and throws.

Context: Encountered while configuring Claude Code to use the IntelliJ MCP server.

Environment:

  • IntelliJ IDEA 2026.1.2, Build #IU-261.24374.151 (May 15, 2026)
  • Claude Code plugin: com.anthropic.code.plugin 0.1.14-beta
  • Runtime: OpenJDK 25.0.2+10-b329.117 aarch64 (JetBrains)
  • macOS 26.3.1, aarch64, 14 cores
  • Exception reporter ID: 240325252e47c5a-baf1-4455-b0d0-598a5ff1586f

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗