fix: use SDK SessionEvent type for copilot-sdk 0.3.0 compat#100
Merged
simongdavies merged 1 commit intohyperlight-dev:mainfrom Apr 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the plugin auditor’s Copilot SDK session event handler typing to stay compatible with @github/copilot-sdk@0.3.0, where SessionEvent became a discriminated union (breaking prior loose inline event shapes).
Changes:
- Import
SessionEventfrom@github/copilot-sdk. - Use
SessionEventas the parameter type for the auditor session.on()handler to satisfy the SDK’sSessionEventHandlertype.
The auditor's session.on() handler used an inline type annotation that is incompatible with the SessionEvent discriminated union in @github/copilot-sdk 0.3.0. Import and use the SDK's SessionEvent type instead — works with both 0.2.x and 0.3.x. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
2e4bdd4 to
98c0298
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unblocks dependabot PR #81 (
@github/copilot-sdk0.2.2 → 0.3.0).Problem
SDK 0.3.0 changed
SessionEventfrom a loose shape to a discriminated union. The auditor'ssession.on()handler used an inline type annotation{ type: string; data?: Record<string, unknown> }which is no longer assignable toSessionEventHandler.Fix
Import
SessionEventfrom the SDK and use it as the handler parameter type. Works with both 0.2.x and 0.3.x.Testing
tsc --noEmitpasses on current SDK (0.2.2)SessionEventtype exists identically in 0.3.0