From 10777ac8d5a460da13d40b62a990c33a0d5f9e25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Jul 2026 08:47:27 +0000 Subject: [PATCH 1/2] Initial plan From 8ac68728ad0269b31f0d943d9af02420954880b5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Jul 2026 09:05:09 +0000 Subject: [PATCH 2/2] fix: preserve invocable protocol precedence in next steps Co-authored-by: v1212 <49907914+v1212@users.noreply.github.com> --- .../internal/cmd/nextstep/resolver.go | 3 ++ .../internal/cmd/nextstep/state.go | 6 ++++ .../internal/cmd/nextstep/state_test.go | 31 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/resolver.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/resolver.go index 4cb658aaea9..83d2eaff273 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/resolver.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/resolver.go @@ -17,6 +17,9 @@ const ( // ProtocolResponses is the value of `agent.yaml#protocol` for plain // text /responses agents. ProtocolResponses = "responses" + // ProtocolInvocationsWS is the value of `agent.yaml#protocol` for + // bidirectional WebSocket /invocations_ws agents. + ProtocolInvocationsWS = "invocations_ws" // placeholderPayload is the single-quoted literal the resolver // emits as the body argument when no concrete payload is known — diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state.go index bf8bc5078c0..037dfc7cee5 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state.go @@ -478,10 +478,13 @@ func loadServiceProtocol(projectPath, relativePath string) string { } sawInvocations := false + sawInvocationsWS := false for _, p := range hosted.Protocols { switch strings.TrimSpace(p.Protocol) { case ProtocolResponses: return ProtocolResponses + case ProtocolInvocationsWS: + sawInvocationsWS = true case ProtocolInvocations: sawInvocations = true } @@ -489,6 +492,9 @@ func loadServiceProtocol(projectPath, relativePath string) string { if sawInvocations { return ProtocolInvocations } + if sawInvocationsWS { + return ProtocolInvocationsWS + } return "" } diff --git a/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state_test.go b/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state_test.go index 4663ad937f2..39f93f243a8 100644 --- a/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state_test.go +++ b/cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/state_test.go @@ -593,6 +593,37 @@ protocols: protocols: - protocol: invocations version: "1.0.0" +`, + want: ProtocolInvocations, + }, + { + name: "single invocations_ws protocol", + manifest: `kind: hostedAgent +protocols: + - protocol: invocations_ws + version: "2.0.0" +`, + want: ProtocolInvocationsWS, + }, + { + name: "responses wins over invocations_ws regardless of order", + manifest: `kind: hostedAgent +protocols: + - protocol: invocations_ws + version: "2.0.0" + - protocol: responses + version: "2.0.0" +`, + want: ProtocolResponses, + }, + { + name: "invocations wins over invocations_ws regardless of order", + manifest: `kind: hostedAgent +protocols: + - protocol: invocations_ws + version: "2.0.0" + - protocol: invocations + version: "1.0.0" `, want: ProtocolInvocations, },