Skip to content

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

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

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

Conversation

@eXamadeus

@eXamadeuseXamadeus commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

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

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

No duplicate PRs found

@eXamadeuseXamadeusFeb 1, 2026

Copy link
Copy Markdown
ContributorAuthor

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.

@eXamadeuseXamadeus mentioned this pull request Feb 1, 2026
@eXamadeus
eXamadeusforce-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch 2 times, most recently from 2c8ff07 to 1ec23b0CompareFebruary 4, 2026 02:48
@eXamadeus
eXamadeusforce-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch 2 times, most recently from 0ea5911 to dc201d0CompareMarch 8, 2026 02:10
@eXamadeus
eXamadeusforce-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch from dc201d0 to 6724d91CompareMarch 23, 2026 16:56
@eXamadeuseXamadeus changed the title fix(types): plugin trigger types are now correct and safefix(types): plugin hook types are now correct and safeMar 23, 2026
@eXamadeus
eXamadeusforce-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch 4 times, most recently from 04b32e7 to 1533758CompareMarch 24, 2026 00:36
@eXamadeus
eXamadeusforce-pushed the julian/fix-types-plugin-trigger-types-are-now-correct-and-safe branch from 1533758 to e4e58f6CompareMarch 26, 2026 13:35
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin package not using latest SDK types

1 participant

@eXamadeus