Remove dead COBO code from azure.ai.agents extension; guard postdeploy handler with ShouldRun#7373
Draft
Remove dead COBO code from azure.ai.agents extension; guard postdeploy handler with ShouldRun#7373
Conversation
Fixes #7201: Remove dead COBO code from parser.go including SetIdentity, CoboPostDeploy, agent registration, hello-world revision management, and all associated helper functions and types (~1130 lines removed). Fixes #7344: Add ShouldRun guard in postdeployHandler so EnsureAgentIdentityRBAC only runs for projects with hosted agents, preventing spurious errors in non-agent projects. Also removes unused SetIdentity calls from preprovision/predeploy handlers and cleans up unused go.mod dependencies (armappcontainers, armresources). Agent-Logs-Url: https://github.com/Azure/azure-dev/sessions/6dcf2a05-05ea-4a1b-a135-6a0e42cbbb1a Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Azure/azure-dev/sessions/6dcf2a05-05ea-4a1b-a135-6a0e42cbbb1a Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
JeffreyCA
March 27, 2026 23:13
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
postdeployHandlerin the azure.ai.agents extension calledEnsureAgentIdentityRBAC()without checking whether the project actually uses agents. This causedAZURE_AI_PROJECT_ID not seterrors in projects that have the extension installed but no agent services. Separately, the entire COBO flow (~1130 lines) was dead code that no longer functions.Bug fix (#7344)
Added a
ShouldRunguard inpostdeployHandlersoEnsureAgentIdentityRBACis skipped for non-agent projects:Dead code removal (#7201)
parser.go: RemovedSetIdentity,CoboPostDeploy, all COBO types (AgentRegistrationPayload,AgentDefinition, etc.), and 12+ helper functions (assignAzureAIRole,registerAgent,deactivateHelloWorldRevision,testDataPlane, etc.). File went from 1197 → 66 lines.listen.go: RemovedSetIdentity()calls frompreprovisionHandler/predeployHandler, simplified their signatures. ReplacedCoboPostDeploy+EnsureAgentIdentityRBACwith just the latter behindShouldRun.go.mod: Dropped unused depsarmappcontainersandarmresources.ShouldRun(wasshouldRun) so thecmdpackage can call it directly.