feat(agents): poll for active state after deploy (container + code)#8175
Conversation
|
@v1212 Why is this needed? We used to have polling for the creation of an agent, but it was changed because the create agent API now only returns once the agent is ready. Is there something different now? |
…paths Replace inline polling in code deploy with shared waitForAgentActive() function. Add polling to container deploy path. Uses 10s interval, 5min timeout, and requires 2 consecutive confirmations to avoid transient flickers.
338f9be to
30d498e
Compare
as Ankit explained in Teams Channel, the PR aims to make the azd deploy more friendly to handle the deploy request and result from platform LRO. quick improvement from this PR is
|
There was a problem hiding this comment.
Pull request overview
Adds post-deploy active-state polling for both container and code deploy paths, consolidating the previously inline remote-build polling into a shared helper waitForAgentActive that uses a 10s interval, 5min timeout, and requires two consecutive matching terminal statuses to avoid flaky transitions. Also exposes Python 3.14 as a selectable code-deploy runtime.
Changes:
- New shared
waitForAgentActivehelper invoked aftercreateAgent(container) and after ZIP create/update (code) when the version is not already active. - Inline remote-build polling in
deployHostedCodeAgentremoved; polling now runs for all code-deploy modes (bundled + remote_build). promptCodeConfigaddspython_3_14to Python-only and mixed runtime choice lists.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go | Adds waitForAgentActive, wires it into container and code deploy flows, removes inline remote_build polling. |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go | Adds Python 3.14 option to runtime selection lists. |
therealjohn
left a comment
There was a problem hiding this comment.
@v1212 Link the issue in the PR, or create one and link it.
|
/check-enforcer override |

Summary
waitForAgentActive()function (10s interval, 5min timeout, 2x consecutive confirmation)Design
Changes
service_target_agent.gowaitForAgentActive()shared polling function; wire it into container deploy path (aftercreateAgent()); replace inline polling in code deploy withwaitForAgentActive()call; now polls for ALL code deploy modes (not just remote_build)init_from_code.goNotes
E2E Test Results (Round 3)
Full E2E testing on
canadacentral(Foundry projectwujia-aifproject260512), branchfeature/deploy-poll-active.Result: 15/15 test phases PASSED
Python (ZIP Upload - Code Deploy)
.NET (ZIP Upload - Code Deploy)
Docker/ACR (Container Deploy)
Key Observations
azd ai agent init+azd deploy+ curl invokeKnown Issues (not caused by this PR)
net10.0in both.csprojandDockerfile— must downgrade tonet9.0(remote build only supports .NET 9)How to Build