Skip to content

feat(ai): add orthogonal Invocations primitives - #9901

Draft
Wei Meng (m5i-work) wants to merge 2 commits into
m5i/9676-responses-primitivesfrom
m5i/9676-invocations-primitives
Draft

feat(ai): add orthogonal Invocations primitives#9901
Wei Meng (m5i-work) wants to merge 2 commits into
m5i/9676-responses-primitivesfrom
m5i/9676-invocations-primitives

Conversation

@m5i-work

@m5i-work Wei Meng (m5i-work) commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

Adds protocol-specific Invocations resource commands on top of the Responses primitives in #9900.

  • adds azd ai agent invocations show [--invocation-id <id>]
  • adds azd ai agent invocations cancel [--invocation-id <id>]
  • saves the latest successful remote Invocation ID for implicit targeting
  • captures IDs from x-agent-invocation-id or a 202 Accepted invocation_id body while preserving the body for existing LRO polling and raw output
  • allows explicit IDs with --agent-endpoint and no project-backed state
  • keeps explicit show/cancel operations from changing current selection
  • treats cancellation of an already terminal Invocation as successful after confirming service state
  • stores only the current Invocation ID; lifecycle operations do not inherit saved session or create context
  • preserves existing synchronous, SSE, raw, and LRO Invocation create behavior

This is PR 2 of the replacement stack for #9676.

CLI

azd ai agent invoke "message" --protocol invocations
azd ai agent invocations show [--invocation-id <id>]
azd ai agent invocations cancel [--invocation-id <id>]

Validation

From cli/azd/extensions/azure.ai.agents:

  • go test ./...
  • go build ./...
  • go fix ./...
  • focused go test -race for Invocation identity, state, command, and endpoint tests
  • command help smoke tests for invocations and invocations show

golangci-lint and cspell were not available on the local PATH; CI runs both.

Stack:

Supersedes #9706.
Fixes #9780

Part of #9676

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@m5i-work

Copy link
Copy Markdown
Member Author

Live E2E validation

Built and installed the full stack with azd x build, then tested against the supplied longrun-invocations-v2-ref endpoint using {"steps":3,"delay_ms":200}.

Passed:

  • existing 202 Accepted behavior captured the Invocation ID, polled, and completed all 3 steps
  • invocations show --invocation-id ... --output table returned the completed Invocation
  • implicit invocations show selected the saved current Invocation and returned the full JSON result
  • lifecycle GET worked using only the Invocation ID/current endpoint, without persisted session context

Reference-agent limitation:

  • POST /invocations/{id}/cancel returned HTTP 404 with cancel_invocation not implemented. The CLI surfaced a classified cancellation failure. This supplied reference agent validates create/poll and one-shot GET, but cannot validate the successful cancel path; that path remains unit-tested.

@m5i-work
Wei Meng (m5i-work) force-pushed the m5i/9676-invocations-primitives branch from 6b86614 to 646639b Compare September 8, 2026 02:09
@m5i-work
Wei Meng (m5i-work) force-pushed the m5i/9676-invocations-primitives branch from 646639b to 7e303a9 Compare September 8, 2026 08:15
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.agents PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/9901/azure-ai-agents.zip"
  • Version: 1.0.0-beta.14.pr.9901.6798094
  • Merge commit: 108e64f

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

Development

Successfully merging this pull request may close these issues.

Retrieve the latest saved Invocation

1 participant