Skip to content

fix(types): plugin hook types are now correct and safe#11567

Open
eXamadeus wants to merge 2 commits intoanomalyco:devfrom
ex-machina-co:julian/fix-types-plugin-trigger-types-are-now-correct-and-safe
Open

fix(types): plugin hook types are now correct and safe#11567
eXamadeus wants to merge 2 commits intoanomalyco:devfrom
ex-machina-co:julian/fix-types-plugin-trigger-types-are-now-correct-and-safe

Conversation

@eXamadeus
Copy link
Copy Markdown
Contributor

@eXamadeus eXamadeus commented Feb 1, 2026

What does this PR do?

Fixes #7147

Related to #12042 (@aryasaatvik helped uncover the issue that led to a split)

This PR fixes a long standing issue with the plugin trigger types not being aligned. They are now FULLY correct and resilient to future divergence.

How did you verify your code works?

Typescript, baby!

Current State

Here's a great example of how this is currently broken, mess up a plugin hook type and see nothing happen:

opencode – pluginsrcindex ts 2026-03-26 at 10 31 59 AM

After This PR

Everything is happy with the correct plugin trigger types, and if we break them, incorrect types will propagate errors as the good Anders Hejlsberg intended!

opencode – sessionprompt ts 2026-03-26 at 10 36 26 AM

GIF Demo

Zight Recording 2026-03-23 at 01 44 12 PM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Copy link
Copy Markdown
Contributor Author

@eXamadeus eXamadeus Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in here are technically all bug fixes. If they break downstream code, it's actually just catching bugs for them. It's the unfortunate side effect of correcting misleading types.

On the bright side, this code is now properly "typed" to the plugin trigger calls. This means the types are fully correct and will maintain correctness as future divergences will show as errors.

@eXamadeus eXamadeus force-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch 2 times, most recently from 2c8ff07 to 1ec23b0 Compare February 4, 2026 02:48
@eXamadeus eXamadeus force-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch 2 times, most recently from 0ea5911 to dc201d0 Compare March 8, 2026 02:10
@eXamadeus eXamadeus force-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch from dc201d0 to 6724d91 Compare March 23, 2026 16:56
@eXamadeus eXamadeus changed the title fix(types): plugin trigger types are now correct and safe fix(types): plugin hook types are now correct and safe Mar 23, 2026
@eXamadeus eXamadeus force-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch 4 times, most recently from 04b32e7 to 1533758 Compare March 24, 2026 00:36
@eXamadeus eXamadeus force-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch from 1533758 to e4e58f6 Compare March 26, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin package not using latest SDK types

1 participant