Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4653738
Add modelCapabilities override to Node SDK
SteveSandersonMS Apr 6, 2026
a2484dc
Add modelCapabilities override to all SDK languages
SteveSandersonMS Apr 6, 2026
2e943bf
Update to latest release and re-run codegen
SteveSandersonMS Apr 7, 2026
d189c79
Address PR review: use LINQ in C# test, fix formatting and lint
SteveSandersonMS Apr 7, 2026
cd5244c
Fix: forward modelCapabilities in Node.js resumeSession path
SteveSandersonMS Apr 7, 2026
62bf520
Fix Go formatting (gofmt)
SteveSandersonMS Apr 7, 2026
8d1af43
Revert Go session events regeneration to avoid breaking change
SteveSandersonMS Apr 7, 2026
9ec25ef
Regenerate all codegen including session events, fix Go DataContent
SteveSandersonMS Apr 7, 2026
f60b67c
Fix E2E test failures: replace fake-test-model, regenerate snapshots
SteveSandersonMS Apr 7, 2026
d895ad6
Fix C# test method names to match shared snapshot filenames
SteveSandersonMS Apr 7, 2026
e98a2c7
Fix fake-test-model in all languages, regenerate snapshots
SteveSandersonMS Apr 7, 2026
49f43fb
Add diagnostic logging to proxy snapshot mismatch errors
SteveSandersonMS Apr 7, 2026
21f0661
Add raw message content to proxy mismatch diagnostics
SteveSandersonMS Apr 7, 2026
be073f2
Fix proxy normalization for array-content user messages
SteveSandersonMS Apr 7, 2026
241b8d8
Fix test isolation: use sendAndWait in blob/attachment tests
SteveSandersonMS Apr 7, 2026
924ebbd
fix: write blob image to disk so model can view it
SteveSandersonMS Apr 7, 2026
400dae4
refactor: clean up proxy match-failure diagnostics for long-term use
SteveSandersonMS Apr 7, 2026
0b51a4d
fix: address PR review comments
SteveSandersonMS Apr 7, 2026
b81febb
fix: exclude arrays from DeepPartial recursion
SteveSandersonMS Apr 7, 2026
b089e0c
fix: use SendAndWait for blob tests in C#/Go/Python
SteveSandersonMS Apr 7, 2026
cf948da
fix: write blob PNG to disk in C#/Go/Python blob tests
SteveSandersonMS Apr 7, 2026
54cbab2
revert: undo unrelated Go scenario changes from codegen
SteveSandersonMS Apr 7, 2026
852c082
revert: restore generated_session_events.go to main
SteveSandersonMS Apr 7, 2026
0606475
revert: restore Go E2E tests that used DataContent.String
SteveSandersonMS Apr 7, 2026
a84b369
fix: revert .Content.String back to .Content in Go E2E tests
SteveSandersonMS Apr 7, 2026
09f7cee
ci: temporarily skip codegen check for this branch
SteveSandersonMS Apr 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: write blob PNG to disk in C#/Go/Python blob tests
Write the test image to workDir so the model can view it successfully.
Without the file on disk, the model runs platform-specific shell
commands (Get-ChildItem vs ls) making the snapshot non-portable.
Also use SendAndWait to prevent request leaking into subsequent tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
SteveSandersonMS and Copilot committed Apr 7, 2026
commit cf948da6db0e74978427d64c9954c710027b67f0
6 changes: 4 additions & 2 deletions dotnet/test/SessionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ public async Task DisposeAsync_From_Handler_Does_Not_Deadlock()
[Fact]
public async Task Should_Accept_Blob_Attachments()
{
var pngBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
await File.WriteAllBytesAsync(Path.Join(Ctx.WorkDir, "test-pixel.png"), Convert.FromBase64String(pngBase64));

var session = await CreateSessionAsync();

await session.SendAndWaitAsync(new MessageOptions
Expand All @@ -603,14 +606,13 @@ await session.SendAndWaitAsync(new MessageOptions
[
new UserMessageDataAttachmentsItemBlob
{
Data = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
Data = pngBase64,
MimeType = "image/png",
DisplayName = "test-pixel.png",
},
],
});

// Just verify send doesn't throw — blob attachment support varies by runtime
await session.DisposeAsync();
}

Expand Down
12 changes: 10 additions & 2 deletions go/internal/e2e/session_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package e2e

import (
"encoding/base64"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
Expand Down Expand Up @@ -1052,14 +1055,20 @@ func TestSessionBlobAttachment(t *testing.T) {
t.Run("should accept blob attachments", func(t *testing.T) {
ctx.ConfigureForTest(t)

// Write the image to disk so the model can view it
data := "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
pngBytes, _ := base64.StdEncoding.DecodeString(data)
if err := os.WriteFile(filepath.Join(ctx.WorkDir, "test-pixel.png"), pngBytes, 0644); err != nil {
t.Fatalf("Failed to write test image: %v", err)
}

session, err := client.CreateSession(t.Context(), &copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
})
if err != nil {
t.Fatalf("Failed to create session: %v", err)
}

data := "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
mimeType := "image/png"
displayName := "test-pixel.png"
_, err = session.SendAndWait(t.Context(), copilot.MessageOptions{
Expand All @@ -1077,7 +1086,6 @@ func TestSessionBlobAttachment(t *testing.T) {
t.Fatalf("Send with blob attachment failed: %v", err)
}

// Just verify send doesn't error — blob attachment support varies by runtime
session.Disconnect()
})
}
Expand Down
15 changes: 9 additions & 6 deletions python/e2e/test_session.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""E2E Session Tests"""

import base64
import os

import pytest
Expand Down Expand Up @@ -611,16 +612,19 @@ def on_event(event):
assert event.data.reasoning_effort == "high"

async def test_should_accept_blob_attachments(self, ctx: E2ETestContext):
session = await ctx.client.create_session(
on_permission_request=PermissionHandler.approve_all
)

# 1x1 transparent PNG pixel, base64-encoded
# Write the image to disk so the model can view it
pixel_png = (
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAY"
"AAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhg"
"GAWjR9awAAAABJRU5ErkJggg=="
)
png_path = os.path.join(ctx.work_dir, "test-pixel.png")
with open(png_path, "wb") as f:
f.write(base64.b64decode(pixel_png))

session = await ctx.client.create_session(
on_permission_request=PermissionHandler.approve_all
)

await session.send_and_wait(
"Describe this image",
Expand All @@ -634,7 +638,6 @@ async def test_should_accept_blob_attachments(self, ctx: E2ETestContext):
],
)

# Just verify send doesn't throw — blob attachment support varies by runtime
await session.disconnect()


Expand Down
68 changes: 15 additions & 53 deletions test/snapshots/session/should_accept_blob_attachments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ conversations:
test-pixel.png
[image]
- role: assistant
content: I'll view the image for you.
content: I'll view the image file to describe it for you.
- role: assistant
tool_calls:
- id: toolcall_0
Expand All @@ -34,7 +34,7 @@ conversations:
test-pixel.png
[image]
- role: assistant
content: I'll view the image for you.
content: I'll view the image file to describe it for you.
tool_calls:
- id: toolcall_0
type: function
Expand All @@ -51,64 +51,26 @@ conversations:
content: Intent logged
- role: tool
tool_call_id: toolcall_1
content: Path ${workdir}/test-pixel.png does not exist. Please provide a valid path.
- role: assistant
content: "Let me check what files are in the current directory:"
- role: assistant
tool_calls:
- id: toolcall_2
type: function
function:
name: ${shell}
arguments: '{"command":"Get-ChildItem","description":"List current directory contents"}'
- messages:
- role: system
content: ${system}
content: Viewed image file successfully.
- role: user
content: |-
Describe this image
test-pixel.png
Image file at path ${workdir}/test-pixel.png
[image]
- role: assistant
content: I'll view the image for you.
tool_calls:
- id: toolcall_0
type: function
function:
name: report_intent
arguments: '{"intent":"Viewing image file"}'
- id: toolcall_1
type: function
function:
name: view
arguments: '{"path":"${workdir}/test-pixel.png"}'
- role: tool
tool_call_id: toolcall_0
content: Intent logged
- role: tool
tool_call_id: toolcall_1
content: Path ${workdir}/test-pixel.png does not exist. Please provide a valid path.
- role: assistant
content: "Let me check what files are in the current directory:"
tool_calls:
- id: toolcall_2
type: function
function:
name: ${shell}
arguments: '{"command":"Get-ChildItem","description":"List current directory contents"}'
- role: tool
tool_call_id: toolcall_2
content: <exited with exit code 0>
- role: assistant
content: >-
The directory appears to be empty. The image "test-pixel.png" you mentioned doesn't exist in the current
working directory yet.
This is an extremely small image - it appears to be essentially a **single white pixel** or a very tiny white
square on a transparent background. The image is minimal in size and content, likely just a few pixels in
dimension. It's the kind of test image that might be used for:


- Testing image loading/rendering functionality

- Placeholder purposes

Could you please provide the image file or let me know where it's located? You can:
- Minimal file size requirements

1. Upload/attach the image file
- Image processing pipeline validation

2. Specify the correct path to the image

3. Move the image to the current directory
The file name "test-pixel.png" confirms this is indeed a test image consisting of just a single pixel or very
small pixel cluster.
Loading