Skip to content

fix: use SDK SessionEvent type for copilot-sdk 0.3.0 compat#100

Merged
simongdavies merged 1 commit intohyperlight-dev:mainfrom
simongdavies:fix/copilot-sdk-session-event-type
Apr 30, 2026
Merged

fix: use SDK SessionEvent type for copilot-sdk 0.3.0 compat#100
simongdavies merged 1 commit intohyperlight-dev:mainfrom
simongdavies:fix/copilot-sdk-session-event-type

Conversation

@simongdavies
Copy link
Copy Markdown
Member

Unblocks dependabot PR #81 (@github/copilot-sdk 0.2.2 → 0.3.0).

Problem

SDK 0.3.0 changed SessionEvent from a loose shape to a discriminated union. The auditor's session.on() handler used an inline type annotation { type: string; data?: Record<string, unknown> } which is no longer assignable to SessionEventHandler.

error TS2345: Argument of type '(event: { type: string; data?: Record<string, unknown>; }) => void'
  is not assignable to parameter of type 'SessionEventHandler'.

Fix

Import SessionEvent from the SDK and use it as the handler parameter type. Works with both 0.2.x and 0.3.x.

Testing

  • tsc --noEmit passes on current SDK (0.2.2)
  • Verified SessionEvent type exists identically in 0.3.0

Copilot AI review requested due to automatic review settings April 30, 2026 21:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 SessionEvent from @github/copilot-sdk.
  • Use SessionEvent as the parameter type for the auditor session .on() handler to satisfy the SDK’s SessionEventHandler type.

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>
@simongdavies simongdavies force-pushed the fix/copilot-sdk-session-event-type branch from 2e4bdd4 to 98c0298 Compare April 30, 2026 21:44
@simongdavies simongdavies merged commit 574470f into hyperlight-dev:main Apr 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants