Skip to content

fix(node): exclude internal events from public union#2079

Open
hogeheer499-commits wants to merge 1 commit into
github:mainfrom
hogeheer499-commits:agent/fix-session-event-internal-union
Open

fix(node): exclude internal events from public union#2079
hogeheer499-commits wants to merge 1 commit into
github:mainfrom
hogeheer499-commits:agent/fix-session-event-internal-union

Conversation

@hogeheer499-commits

Copy link
Copy Markdown

Summary

Fix the Node SDK's generated public SessionEvent declaration after internal event wrappers are stripped from the published package.

The generator already excluded variants whose data schema is internal, but assistant.turn_retry and model.call_start mark the event wrapper itself as internal. Their interfaces were removed by stripInternal, while their names remained in the public union. This left the published declaration with unresolved references and caused event payload types to degrade for consumers using skipLibCheck.

This change filters variants when either the resolved wrapper or its data schema is internal, regenerates the TypeScript session events, and adds a regression test for the wrapper-internal/data-public case.

Fixes #2078.

Validation

  • npx vitest run test/*.test.ts — 243 tests passed
  • npm run build
  • npm run typecheck
  • npm run lint — no errors (3 existing warnings)
  • npm run format:check
  • Compiled dist/generated/session-events.d.ts with skipLibCheck: false
  • git diff --check

@hogeheer499-commits
hogeheer499-commits marked this pull request as ready for review July 24, 2026 21:30
@hogeheer499-commits
hogeheer499-commits requested a review from a team as a code owner July 24, 2026 21:30
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.

1.0.8 breaks typing on events

1 participant