Skip to content

[Agents extension] Adding /invocations support#7422

Merged
rajeshkamal5050 merged 13 commits intomainfrom
trangevi/new-invoke-api
Apr 2, 2026
Merged

[Agents extension] Adding /invocations support#7422
rajeshkamal5050 merged 13 commits intomainfrom
trangevi/new-invoke-api

Conversation

@trangevi
Copy link
Copy Markdown
Member

@trangevi trangevi commented Apr 1, 2026

Adding support for the new /invocations API. This uses the new agent endpoint route, and updates the /responses handling to do the same.

/invocations calls can accept any input, based on the agent, so we do no validation on it and instead just pass it along to the agent, relying on the agent to handle it.

Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi changed the title Trangevi/new invoke api [Agents extension] Adding /invocations support Apr 1, 2026
trangevi added 2 commits April 1, 2026 13:20
Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi requested a review from Copilot April 1, 2026 20:33
@trangevi trangevi marked this pull request as ready for review April 1, 2026 20:33
@trangevi trangevi marked this pull request as draft April 1, 2026 20:33
@therealjohn
Copy link
Copy Markdown
Contributor

Fixes #7431
Fixes #7245

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support to the azure.ai.agents extension for invoking agents via the new /invocations protocol, including protocol auto-detection from agent.yaml and improved session handling, while also updating the existing /responses remote route to use the newer agent endpoint URL shape.

Changes:

  • Add invocations as a supported agent protocol and route invoke execution to either /responses or /invocations based on agent.yaml.
  • Add --input-file/-f to send a file body for invoke calls (primarily for structured invocations payloads).
  • Normalize ACR login server values when setting AZURE_CONTAINER_REGISTRY_ENDPOINT, plus unit tests for the normalization helper.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_api/models.go Adds the invocations protocol constant for protocol switching.
cli/azd/extensions/azure.ai.agents/internal/exterrors/codes.go Adds validation codes used by new CLI argument validation paths.
cli/azd/extensions/azure.ai.agents/internal/cmd/invoke.go Implements invocations local/remote flows, protocol routing, file-body support, and LRO/SSE/sync response handlers.
cli/azd/extensions/azure.ai.agents/internal/cmd/invoke_test.go Adds unit tests for invocations response handling and file/message body resolution.
cli/azd/extensions/azure.ai.agents/internal/cmd/helpers.go Updates session persistence behavior, adds OpenAPI spec caching, invocation ID persistence, and protocol detection from agent.yaml.
cli/azd/extensions/azure.ai.agents/internal/cmd/init_foundry_resources_helpers.go Normalizes ACR endpoints before lookup and before persisting to env vars.
cli/azd/extensions/azure.ai.agents/internal/cmd/init_foundry_resources_helpers_test.go Adds tests for normalizeLoginServer.

trangevi added 2 commits April 1, 2026 14:11
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi marked this pull request as ready for review April 1, 2026 23:11
@trangevi trangevi requested a review from jongio as a code owner April 1, 2026 23:11
@trangevi trangevi linked an issue Apr 1, 2026 that may be closed by this pull request
@trangevi trangevi linked an issue Apr 1, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Member

@jongio jongio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid dispatch architecture for the invocations protocol - the sync/SSE/LRO handler split is clean.

Issues to address:

  • invoke.go:441,535 - session ID concatenated into URLs without encoding; user-provided --session values can corrupt the query string
  • invoke.go:703 - handleInvocationLRO has zero test coverage despite being the most complex new code path

@JeffreyCA JeffreyCA added the ext-agents azure.ai.agents extension label Apr 2, 2026
Copy link
Copy Markdown
Contributor

@therealjohn therealjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to also tackle #7419 in this?

Update to the --session and --conversation flags to be --session-id and --conversation-id?

Signed-off-by: trangevi <trangevi@microsoft.com>
trangevi added 3 commits April 2, 2026 10:08
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

6 participants