Fix Go session event attachment aliases#1515
Open
dmytrostruk wants to merge 1 commit into
Open
Conversation
Contributor
Cross-SDK Consistency Review ✅This PR makes targeted changes to Go-specific codegen infrastructure ( No cross-SDK consistency issues found. Here's why:
This is a housekeeping fix for Go's generated code to stay in sync with the evolving runtime schema, and it does not create any API parity gaps with other language SDKs.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Go code generation so public aliases remain stable when runtime schemas promote formerly event-specific definitions into shared API/session-event definitions.
Changes:
- Filters legacy Go session-event compatibility aliases so stale or conflicting aliases are skipped.
- Moves public
ContextTierownership from manual Go code to generated aliases. - Regenerates Go public session-event aliases to preserve current-schema compatibility.
Show a summary per file
| File | Description |
|---|---|
scripts/codegen/go.ts |
Adds alias filtering and legacy ContextTier bridge generation. |
go/zsession_events.go |
Re-exports ContextTier and constants through generated aliases. |
go/types.go |
Removes the manual ContextTier type and constants. |
Copilot's findings
Files not reviewed (1)
- go/zsession_events.go: Language not supported
- Files reviewed: 2/3 changed files
- Comments generated: 0
4201799 to
c9e3f88
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.
Summary
Attachment/AttachmentTypefailure from the runtime bump workflow.Root Cause
Runtime
1.0.57-2promotesAttachmentand related attachment definitions into shared API/session-event schema definitions. Go session-event codegen still always emitted legacy compatibility aliases likeAttachment = UserMessageAttachment, but those oldUserMessageAttachment*generated names no longer exist once the sharedrpc.Attachment*definitions are generated.That made the runtime bump workflow fail during Go generation with duplicate/stale
AttachmentandAttachmentTypedeclarations.Fix
The session-event generator now validates compatibility aliases before emitting them:
With the new runtime schema,
Attachmentis emitted through the normal shared alias path asAttachment = rpc.Attachment, and the staleUserMessageAttachment*aliases are skipped.Out of Scope
This PR intentionally does not change
ContextTier. If the runtime bump exposes a separateContextTierduplicate after theAttachmentissue is fixed, that should be handled separately from this narrow generator fix.Validation
npm run generate:gonpx tsx go.ts <@github/copilot@1.0.57-2 session-events.schema.json> <@github/copilot@1.0.57-2 api.schema.json>git diff --check