Skip to content

Commit 66d056b

Browse files
Fix remaining E2E tests missing permission handler
- Go: client_test.go CreateSession calls need OnPermissionRequest - Python: test_client.py create_session call needs config arg Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7a43bfd commit 66d056b

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

go/internal/e2e/client_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ func TestClient(t *testing.T) {
9494
})
9595
t.Cleanup(func() { client.ForceStop() })
9696

97-
_, err := client.CreateSession(t.Context(), nil)
97+
_, err := client.CreateSession(t.Context(), &copilot.SessionConfig{
98+
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
99+
})
98100
if err != nil {
99101
t.Fatalf("Failed to create session: %v", err)
100102
}
@@ -118,7 +120,9 @@ func TestClient(t *testing.T) {
118120
})
119121
t.Cleanup(func() { client.ForceStop() })
120122

121-
_, err := client.CreateSession(t.Context(), nil)
123+
_, err := client.CreateSession(t.Context(), &copilot.SessionConfig{
124+
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
125+
})
122126
if err != nil {
123127
t.Fatalf("Failed to create session: %v", err)
124128
}

python/e2e/test_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ async def test_should_report_error_with_stderr_when_cli_fails_to_start(self):
206206

207207
# Verify subsequent calls also fail (don't hang)
208208
with pytest.raises(Exception) as exc_info2:
209-
session = await client.create_session()
209+
session = await client.create_session(
210+
{"on_permission_request": PermissionHandler.approve_all}
211+
)
210212
await session.send("test")
211213
# Error message varies by platform (EINVAL on Windows, EPIPE on Linux)
212214
error_msg = str(exc_info2.value).lower()

0 commit comments

Comments
 (0)