Skip to content

Commit c8f88c7

Browse files
github-actions[bot]stephentoubCopilot
authored
Update @github/copilot to 1.0.57-2 (#1517)
* Update @github/copilot to 1.0.57-2 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code * Synthesize shared anyOf discriminator aliases and exclude hand-written collisions Follows up on #1515. Adds two pieces of generator hardening on top of the conditional alias emit that #1515 introduced. 1. `collectGoSharedAnyOfDiscriminatorAliasNames`: detect shared anyOf unions with a string-const discriminator property and synthesize the discriminator enum name + per-variant const names so the public `copilot` alias file re-exports them alongside the union and variant structs. Without this, schema-shared discriminated unions like `Attachment` (in the bumped schema) would expose `copilot.Attachment` and its variant structs but not `copilot.AttachmentType` / `copilot.AttachmentTypeFile` etc. 2. `collectHandWrittenGoPublicNames`: scan hand-written `go/*.go` files for exported type/const names and exclude them from the alias file so schema-shared definitions that happen to share a name with a hand-written declaration (e.g. `ContextTier`) don't double-declare in the `copilot` package and break `go build`. Note from #1515 explicitly flagged `ContextTier` as out-of-scope; this handles it. On the current 1.0.56 schema the only behavioural change is that the public `copilot` package now also re-exports the `UserToolSessionApprovalKind` discriminator enum and its 8 constants (which the `rpc` package was already exporting). On the bumped 1.0.57+ schema this lets the generator succeed (no more `assertNoGoRpcSessionEventConflicts` failure) and produces the expected `Attachment*` alias surface while letting hand-written `ContextTier` win. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix generated type collisions after Copilot update Remove handwritten ContextTier definitions now owned by generated schema types, update Attachment type references, and keep generated outputs in sync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Rust import generation and Python test import ordering - Rust generator: merge crate::types imports in api_types.rs so the source matches what rustfmt produces on Linux (joining adjacent use crate::types::... lines). This unbreaks the Codegen Check on CI. - Python: sort the import block in test_event_forward_compatibility.py to satisfy ruff I001. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Go session event union decoding Register shared API union decoders when generating Go session event payload unmarshalling so event data can decode attachments and approvals referenced from the API schema. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Stephen Toub <stoub@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fa275a0 commit c8f88c7

35 files changed

Lines changed: 3585 additions & 2741 deletions

docs/features/image-input.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func main() {
120120
session.Send(ctx, copilot.MessageOptions{
121121
Prompt: "Describe what you see in this image",
122122
Attachments: []copilot.Attachment{
123-
&copilot.UserMessageAttachmentFile{
123+
&copilot.AttachmentFile{
124124
DisplayName: "screenshot.png",
125125
Path: path,
126126
},
@@ -146,7 +146,7 @@ path := "/absolute/path/to/screenshot.png"
146146
session.Send(ctx, copilot.MessageOptions{
147147
Prompt: "Describe what you see in this image",
148148
Attachments: []copilot.Attachment{
149-
&copilot.UserMessageAttachmentFile{
149+
&copilot.AttachmentFile{
150150
DisplayName: "screenshot.png",
151151
Path: path,
152152
},
@@ -179,9 +179,9 @@ public static class ImageInputExample
179179
await session.SendAsync(new MessageOptions
180180
{
181181
Prompt = "Describe what you see in this image",
182-
Attachments = new List<UserMessageAttachment>
182+
Attachments = new List<Attachment>
183183
{
184-
new UserMessageAttachmentFile
184+
new AttachmentFile
185185
{
186186
Path = "/absolute/path/to/screenshot.png",
187187
DisplayName = "screenshot.png",
@@ -208,9 +208,9 @@ await using var session = await client.CreateSessionAsync(new SessionConfig
208208
await session.SendAsync(new MessageOptions
209209
{
210210
Prompt = "Describe what you see in this image",
211-
Attachments = new List<UserMessageAttachment>
211+
Attachments = new List<Attachment>
212212
{
213-
new UserMessageAttachmentFile
213+
new AttachmentFile
214214
{
215215
Path = "/absolute/path/to/screenshot.png",
216216
DisplayName = "screenshot.png",
@@ -344,7 +344,7 @@ func main() {
344344
session.Send(ctx, copilot.MessageOptions{
345345
Prompt: "Describe what you see in this image",
346346
Attachments: []copilot.Attachment{
347-
&copilot.UserMessageAttachmentBlob{
347+
&copilot.AttachmentBlob{
348348
Data: base64ImageData,
349349
MIMEType: mimeType,
350350
DisplayName: &displayName,
@@ -361,7 +361,7 @@ displayName := "screenshot.png"
361361
session.Send(ctx, copilot.MessageOptions{
362362
Prompt: "Describe what you see in this image",
363363
Attachments: []copilot.Attachment{
364-
&copilot.UserMessageAttachmentBlob{
364+
&copilot.AttachmentBlob{
365365
Data: base64ImageData, // base64-encoded string
366366
MIMEType: mimeType,
367367
DisplayName: &displayName,
@@ -396,9 +396,9 @@ public static class BlobAttachmentExample
396396
await session.SendAsync(new MessageOptions
397397
{
398398
Prompt = "Describe what you see in this image",
399-
Attachments = new List<UserMessageAttachment>
399+
Attachments = new List<Attachment>
400400
{
401-
new UserMessageAttachmentBlob
401+
new AttachmentBlob
402402
{
403403
Data = base64ImageData,
404404
MimeType = "image/png",
@@ -415,9 +415,9 @@ public static class BlobAttachmentExample
415415
await session.SendAsync(new MessageOptions
416416
{
417417
Prompt = "Describe what you see in this image",
418-
Attachments = new List<UserMessageAttachment>
418+
Attachments = new List<Attachment>
419419
{
420-
new UserMessageAttachmentBlob
420+
new AttachmentBlob
421421
{
422422
Data = base64ImageData,
423423
MimeType = "image/png",

0 commit comments

Comments
 (0)