Skip to content

[Agents Extension] Update show and monitor commands to not require parameters#7181

Merged
trangevi merged 2 commits intomainfrom
trangevi/show-monitor-fixes
Mar 18, 2026
Merged

[Agents Extension] Update show and monitor commands to not require parameters#7181
trangevi merged 2 commits intomainfrom
trangevi/show-monitor-fixes

Conversation

@trangevi
Copy link
Member

Other commands rely on the azd service entry to get name/version/etc. details. This PR brings show and monitor in line with the rest

Signed-off-by: trangevi <trangevi@microsoft.com>
Copy link
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

Updates the Azure AI Agents extension show and monitor commands to resolve agent name/version from the azure.yaml service configuration and current azd environment, making these commands consistent with other extension commands and removing the need for explicit --name/--version parameters.

Changes:

  • Update show and monitor to accept an optional positional [service] argument and resolve agent details via azd project/environment APIs.
  • Remove required --name/--version flags (and related account/project flags) from both commands and refresh help/examples accordingly.
  • Adjust unit tests to reflect the new positional-arg behavior and removed required flags.

Reviewed changes

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

File Description
cli/azd/extensions/azure.ai.agents/internal/cmd/show.go Switch show to [service] positional arg and resolve agent name/version from azd project + environment.
cli/azd/extensions/azure.ai.agents/internal/cmd/show_test.go Update tests to validate new arg behavior and removal of required flags.
cli/azd/extensions/azure.ai.agents/internal/cmd/monitor.go Switch monitor to [service] positional arg and resolve agent name/version from azd project + environment; adjust session resolution call site.
cli/azd/extensions/azure.ai.agents/internal/cmd/monitor_test.go Update tests to validate new arg behavior and removal of required flags.
Comments suppressed due to low confidence (1)

cli/azd/extensions/azure.ai.agents/internal/cmd/monitor.go:121

  • newMonitorCommand creates an AzdClient (azdext.NewAzdClient) and later resolveMonitorSession() creates a second AzdClient internally. Since monitor now always needs an AzdClient to resolve the service, consider passing the existing client into resolveMonitorSession (or refactoring resolveMonitorSession to accept the already-loaded env/config path) to avoid redundant gRPC connection setup on every run.
			// When vnext is enabled, resolve session ID for session-based logstream.
			if flags.sessionID == "" {
				sessionID, vnext := resolveMonitorSession(ctx, info.AgentName)
				if vnext {
					if sessionID == "" {
						return exterrors.Validation(
							exterrors.CodeInvalidSessionId,
							"VNext agents are currently enabled and require a session ID for log streaming.",
							"Specify the session ID using --session, or run `azd ai agent invoke` first to create one",
						)
					}
					flags.sessionID = sessionID
				}

You can also share your feedback on Copilot code review. Take the survey.

Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi enabled auto-merge (squash) March 18, 2026 17:28
@trangevi trangevi merged commit 5b61b22 into main Mar 18, 2026
17 checks passed
@trangevi trangevi deleted the trangevi/show-monitor-fixes branch March 18, 2026 18:20
Copilot AI added a commit that referenced this pull request Mar 18, 2026
…7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Mar 18, 2026
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
rajeshkamal5050 added a commit that referenced this pull request Mar 18, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (#7141, #7175, #7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move #7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
github-actions bot added a commit to weikanglim/azure-dev that referenced this pull request Mar 18, 2026
- Add 1.24.0-beta.1 unreleased section to cli/azd/CHANGELOG.md
  with entries for configurable deploy timeout (Azure#7045), git dirty
  check and workflow consent for azd init agent mode (Azure#7162),
  cobra command tree fix (Azure#7171), and input validation improvements (Azure#7175)
- Bump cli/version.txt to 1.24.0-beta.1
- Add 0.1.16-preview section to agents CHANGELOG with entries
  for file operations (Azure#7141), input validation (Azure#7175), and
  breaking change for show/monitor commands (Azure#7181)
- Bump agents version.txt and extension.yaml to 0.1.16-preview

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wbreza pushed a commit to wbreza/azure-dev that referenced this pull request Mar 18, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
wbreza pushed a commit to wbreza/azure-dev that referenced this pull request Mar 18, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants