[PR #3413] feat: add session.started event that triggers when a new session is created #10629

Closed
opened 2026-02-16 18:15:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/3413

State: closed
Merged: Yes


Motivation

I want to create a plugin that:

  1. Runs when I start a new session
  2. Checks if the AGENTS.md file is present
  3. Warns the user if it's missing

I didn't find an event suited for that.

Proposed solution

I added an event session.started that triggers when a session starts.
I believe this will be useful for other plugins too.

FYI

  • I added a test but I could not test a plugin that uses this event.
  • I believe some types need to be updated.
  • I think we should update the documentation to clearly list all events that can be used in plugins. I could update the file /packages/web/src/content/docs/plugins.mdx but maybe there's a way to keep that list updated in the docs.
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/3413 **State:** closed **Merged:** Yes --- # Motivation I want to create a plugin that: 1. Runs when I start a new session 2. Checks if the `AGENTS.md` file is present 3. Warns the user if it's missing I didn't find an event suited for that. # Proposed solution I added an event `session.started` that triggers when a session starts. I believe this will be useful for other plugins too. # FYI - I added a test but I could not test a plugin that uses this event. - I believe some types need to be updated. - I think we should update the documentation to clearly list all events that can be used in plugins. I could update the file `/packages/web/src/content/docs/plugins.mdx` but maybe there's a way to keep that list updated in the docs.
yindo added the pull-request label 2026-02-16 18:15:20 -05:00
yindo closed this issue 2026-02-16 18:15:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10629