Skip to content

Plugin event listener for "session.created" not firing #14808

@M4NZEN

Description

@M4NZEN

Description

Plugins that subscribe to the event bus are not receiving the session.created event. The event is published but plugins don't respond.

Plugins

Custom plugin in ~/.config/opencode/plugins/engram.ts (Engram memory system)

OpenCode version

1.2.10

Steps to reproduce

  1. Create a plugin that listens to session.created via the event property
  2. Start a new OpenCode session
  3. Plugin doesn't receive the event

Screenshot and/or share link

Evidence: Engram does not activate automatically

Problem

According to AGENTS.md, mem_session_start should execute automatically at the start of each session.
But it doesn't happen - the user had to call it manually.

Log Evidence (opencode_session_created_bug.log)

Line 15 - Plugin loads:
INFO service=plugin path=...engram.ts loading plugin

Line 55 - MCP detected:
INFO service=mcp key=engram type=local found

Line 78 - MCP created:
INFO service=mcp key=engram toolCount=14 create() successfully created client

Lines 89-90 - ERRORS (here's the problem):
ERROR service=mcp clientName=engram error=MCP error -32601: prompts not supported
ERROR service=mcp clientName=engram error=MCP error -32601: resources not supported

Line 96 - OpenCode session created (without Engram):
INFO service=session id=ses_... created

Line 329 - ONLY HERE mem_session_start is called (manual):
INFO service=permission permission=engram_mem_session_start pattern=* ... evaluated

Conclusion

  1. Engram plugin loads
  2. There are MCP errors (prompts/resources not supported)
  3. OpenCode session is created
  4. mem_session_start is NEVER executed automatically
  5. It only executes when the user calls it manually (line 329)

Possible Cause

The -32601 errors on lines 89-90 suggest that the Engram plugin does not support
some MCP methods that OpenCode expects, wh

Operating System

ubuntu 22

Terminal

Alacritty

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions