Skip to content

Commit 7780b50

Browse files
github-actions[bot]stephentoubCopilot
authored
Update @github/copilot to 1.0.55-6 (#1471)
* Update @github/copilot to 1.0.55-6 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code * Update canvas API for canvas.action.invoke rename in 1.0.55-6 The 1.0.55-6 schema renamed the Canvas action invocation API: - `CanvasInvokeActionRequest` -> `CanvasActionInvokeRequest` - `CanvasInvokeActionResult` -> `CanvasActionInvokeResult` - Host API `canvas.invokeAction(...)` -> `canvas.action.invoke(...)` - Provider handler `invokeAction`/`invoke_action`/`InvokeAction` -> `invoke`/`Invoke` - Wire methods `session.canvas.invokeAction` / `canvas.invokeAction` -> `session.canvas.action.invoke` / `canvas.action.invoke` - Rust constants `SESSION_CANVAS_INVOKEACTION` / `CANVAS_INVOKEACTION` -> `SESSION_CANVAS_ACTION_INVOKE` / `CANVAS_ACTION_INVOKE` The provider-side request type `CanvasProviderInvokeActionRequest` is unchanged. Update the host/provider adapters and tests in Node, Python, Go, .NET, and Rust to follow the new nested `action` group and renamed handler method. Also fix a Python codegen bug in `scripts/codegen/python.ts`: `emitClientSessionApiRegistration` was iterating only top-level methods of each handler group via `Object.entries(...).filter(isRpcMethod)`, so methods nested under sub-groups (like `canvas.action.*`) were silently dropped from the generated `CanvasHandler` Protocol and from `register_client_session_api_handlers`. Use the existing recursive `collectRpcMethods` helper and derive the handler method name from the last segment of the RPC method path, matching how TS/C#/Go/Rust codegens already flatten nested groups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Wait for session.start in OnEvent tests In CLI 1.0.55-6 the `session.start` event is dispatched via the asynchronous `session.event` notification channel, so it may not be delivered to the `onEvent`/`on_event` callback by the time `createSession` returns. Update the Node and Python `should receive session events` tests to wait for the event using `vi.waitFor`/`asyncio.Event`. The .NET and Go equivalents already use async wait primitives (`TaskCompletionSource`/channel + timeout). 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 102cd3e commit 7780b50

35 files changed

Lines changed: 377 additions & 308 deletions

dotnet/src/Canvas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ internal partial class CanvasJsonContext : JsonSerializerContext;
130130
/// <remarks>
131131
/// A session installs a single <see cref="ICanvasHandler"/> via
132132
/// <c>SessionConfigBase.CanvasHandler</c>. The handler receives every
133-
/// inbound <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.invokeAction</c>
133+
/// inbound <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.action.invoke</c>
134134
/// JSON-RPC request the runtime issues for this session and decides — typically
135135
/// by inspecting <see cref="CanvasProviderOpenRequest.CanvasId"/> — which
136136
/// application-side canvas should handle the call.

dotnet/src/Generated/Rpc.cs

Lines changed: 28 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet/src/Session.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ public async Task CloseAsync(CanvasProviderCloseRequest request, CancellationTok
939939
}
940940
}
941941

942-
public async Task<object> InvokeActionAsync(CanvasProviderInvokeActionRequest request, CancellationToken cancellationToken = default)
942+
public async Task<object> InvokeAsync(CanvasProviderInvokeActionRequest request, CancellationToken cancellationToken = default)
943943
{
944944
try
945945
{

dotnet/src/Types.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2630,7 +2630,7 @@ protected SessionConfigBase(SessionConfigBase? other)
26302630

26312631
/// <summary>
26322632
/// Provider-side canvas lifecycle handler. The SDK routes inbound
2633-
/// <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.invokeAction</c>
2633+
/// <c>canvas.open</c> / <c>canvas.close</c> / <c>canvas.action.invoke</c>
26342634
/// requests to this handler.
26352635
/// </summary>
26362636
[Experimental(Diagnostics.Experimental)]

dotnet/test/E2E/CanvasE2ETests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ await session.Rpc.Canvas.OpenAsync(
7777
extensionId: canvas.ExtensionId,
7878
input: new Dictionary<string, object> { ["start"] = 41 });
7979

80-
var result = await session.Rpc.Canvas.InvokeActionAsync(
80+
var result = await session.Rpc.Canvas.Action.InvokeAsync(
8181
instanceId: "counter-1",
8282
actionName: "increment",
8383
input: new Dictionary<string, object> { ["delta"] = 1 });

go/canvas.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func CanvasErrorNoHandler() *CanvasError {
7070
//
7171
// A session installs a single CanvasHandler (via SessionConfig.CanvasHandler).
7272
// The handler receives every inbound `canvas.open` / `canvas.close` /
73-
// `canvas.invokeAction` JSON-RPC request the runtime issues for this session
73+
// `canvas.action.invoke` JSON-RPC request the runtime issues for this session
7474
// and decides — typically by inspecting CanvasProviderOpenRequest.CanvasID — which
7575
// application-side canvas should handle the call.
7676
//

go/canvas_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TestCanvasAdapter_DispatchesToHandler(t *testing.T) {
156156
t.Fatalf("response URL not propagated: %+v", openResp)
157157
}
158158

159-
actionResp, err := session.clientSessionApis.Canvas.InvokeAction(&rpc.CanvasProviderInvokeActionRequest{
159+
actionResp, err := session.clientSessionApis.Canvas.Invoke(&rpc.CanvasProviderInvokeActionRequest{
160160
SessionID: "s1",
161161
ExtensionID: "project:echo",
162162
CanvasID: "echo",
@@ -284,7 +284,7 @@ func TestCanvasRegisterClientSessionApiHandlers_RawJSONRoundTrip(t *testing.T) {
284284
t.Fatalf("expected status=ready, got %v", decoded["status"])
285285
}
286286

287-
actionRaw, err := requester.Request("canvas.invokeAction", map[string]any{
287+
actionRaw, err := requester.Request("canvas.action.invoke", map[string]any{
288288
"sessionId": "s1",
289289
"extensionId": "ext",
290290
"canvasId": "echo",

go/internal/e2e/canvas_e2e_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ func TestCanvasE2E(t *testing.T) {
7878
t.Fatalf("unexpected open calls: %+v", calls)
7979
}
8080

81-
actionResult, err := session.RPC.Canvas.InvokeAction(t.Context(), &rpc.CanvasInvokeActionRequest{
81+
actionResult, err := session.RPC.Canvas.Action().Invoke(t.Context(), &rpc.CanvasActionInvokeRequest{
8282
InstanceID: "counter-1",
8383
ActionName: "increment",
8484
Input: map[string]any{
8585
"amount": float64(2),
8686
},
8787
})
8888
if err != nil {
89-
t.Fatalf("Canvas.InvokeAction failed: %v", err)
89+
t.Fatalf("Canvas.Action.Invoke failed: %v", err)
9090
}
9191
actionPayload, ok := actionResult.Result.(map[string]any)
9292
if !ok || actionPayload["count"] != float64(5) {

go/rpc/zrpc.go

Lines changed: 60 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (a *canvasClientSessionAdapter) Close(request *rpc.CanvasProviderCloseReque
152152
return nil, nil
153153
}
154154

155-
func (a *canvasClientSessionAdapter) InvokeAction(request *rpc.CanvasProviderInvokeActionRequest) (any, error) {
155+
func (a *canvasClientSessionAdapter) Invoke(request *rpc.CanvasProviderInvokeActionRequest) (any, error) {
156156
if request == nil {
157157
return nil, canvasJSONRPCError(NewCanvasError("canvas_handler_unset", "missing canvas action request"))
158158
}

0 commit comments

Comments
 (0)