feat(ai): add orthogonal Responses primitives - #9900
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). 20 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Legacy-state repair guidance is incorrect, core HTTP lifecycle paths lack tests, and several added lines violate the enforced length limit.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Replaces workflow-oriented resumable Responses with direct create, show, follow, and cancel primitives.
Changes:
- Adds background invocation with optional no-wait behavior.
- Adds Responses lifecycle commands and in-memory reconnect cursors.
- Simplifies persisted state to the latest Response ID.
File summaries
| File | Description |
|---|---|
internal/exterrors/codes.go |
Updates Response error and operation codes. |
internal/cmd/root.go |
Registers the Responses command group. |
internal/cmd/responses.go |
Implements show, follow, and cancel. |
internal/cmd/responses_test.go |
Tests command structure and formatting. |
internal/cmd/listen.go |
Updates cleanup terminology. |
internal/cmd/invoke.go |
Adds background and no-wait invocation. |
internal/cmd/invoke_responses_stream.go |
Classifies interrupted streams for reconnect. |
internal/cmd/invoke_response_store.go |
Simplifies state and supports legacy reads. |
internal/cmd/invoke_response_store_test.go |
Tests simplified persistence. |
internal/cmd/invoke_background.go |
Implements tracking and follow retries. |
internal/cmd/invoke_background_test.go |
Tests background primitives. |
internal/cmd/delete.go |
Updates cleanup terminology. |
internal/cmd/agent_endpoint.go |
Builds lifecycle endpoint URLs. |
docs/specs/long-running-agent-invoke.md |
Rewrites the protocol specification. |
Review details
Suppressed comments (1)
cli/azd/extensions/azure.ai.agents/internal/cmd/responses.go:385
- This line is 131 columns with tabs expanded to width 4, so the enabled
lllcheck will reject it. Split the error construction to comply with the 125-column limit documented incli/azd/AGENTS.md:115-126.
return responseSnapshotResult{}, fmt.Errorf("Response snapshot ID %q does not match requested ID %q", actualID, responseID)
- Files reviewed: 14/14 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
Live E2E validationBuilt and installed this stack with Passed:
Observed service constraint:
|
|
CI triage: the sole failed check on the previous head was live build 6797057. Its code-deploy scenario timed out after 30 activation polls with last status |
azure.ai.agents PR buildNote 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/9900/azure-ai-agents.zip"
|
Summary
Replaces the workflow-oriented resumable Responses model with orthogonal CLI primitives that map directly to the service API.
azd ai agent invoke, with--backgroundand--background --no-waitazd ai agent responses show|follow|cancel--response-idtargeting, including with--agent-endpoint, without changing current selectionresponses followone streaming GET that always replays from the beginning, with no cursor or automatic reconnectThis is PR 1 of a new two-PR stack. A second PR will add matching Invocations
showandcancelprimitives without changing existing Invocation POST execution behavior.Supersedes the Responses portions of #9704 and all steering-specific behavior in #9705.
CLI
Validation
From
cli/azd/extensions/azure.ai.agents:go test ./...go build ./...go fix ./...go test -racefor the new Response state, command, stream, follow, and detach testsresponses,responses show, andinvokegolangci-lintandcspellwere not available on the local PATH; CI runs both.Fixes #9778
Part of #9676