Skip to content

Stack the azure.ai.agents Next: guidance block with command highlighting#8731

Open
therealjohn wants to merge 3 commits into
Azure:mainfrom
therealjohn:johmil/agent-nextstep-stacked-format
Open

Stack the azure.ai.agents Next: guidance block with command highlighting#8731
therealjohn wants to merge 3 commits into
Azure:mainfrom
therealjohn:johmil/agent-nextstep-stacked-format

Conversation

@therealjohn

Copy link
Copy Markdown
Contributor

Fixes #8730

What

Restyles the Next: guidance block rendered by the azure.ai.agents extension after a successful azd ai agent deploy (and in show / init / doctor).

Before -- dense, right-aligned rows:

Next:  azd ai agent show <name>                  -- verify it's running
       see <path>/README.md                      -- find the sample-specific payload
       azd ai agent invoke <name> '<payload>'    -- test with the sample-specific payload

After -- stacked layout:

Next:
  azd ai agent show <name>
  verify it's running

  see <path>/README.md
  find the sample-specific payload

  azd ai agent invoke <name> '<payload>'
  test with the sample-specific payload
  • Next: header on its own line; each suggestion is a command line over its description line, indented, with a blank line between suggestions.
  • Runnable azd commands are highlighted; see ... / edit agent.yaml: ... pointers stay plain.
  • Applies to all Next: blocks (deploy note plus the show / init / doctor flows).

Changes

  • internal/cmd/nextstep/format.go: stacked renderer plus a highlightCommand helper; FormatNextForNote emits a leading blank line and drops the old 4-space continuation pre-indent. Sorting / truncation / trailing-reservation semantics are unchanged.
  • internal/project/service_target_agent.go: append the Next: block with a single newline since the block now carries its own leading newline.
  • internal/cmd/nextstep/format_test.go: updated layout goldens, TestMain color suppression, and a highlight-routing test.

Validation

  • go build ./... and go test ./... pass for the extension.
  • golangci-lint run reports 0 issues; cspell clean; copyright headers present.
  • No go.mod / go.sum changes.

Copilot AI review requested due to automatic review settings June 19, 2026 17:53
@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jun 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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’s Next: guidance rendering to a more readable stacked layout and adds command highlighting for runnable azd ... suggestions, aligning the behavior across deploy notes and the show / init / doctor flows.

Changes:

  • Reworked Next: formatting to render a header line followed by command/description pairs with blank separators.
  • Added highlightCommand so runnable azd ... commands are highlighted while non-command pointers remain plain.
  • Updated deploy-note concatenation and refreshed formatter goldens + added a highlight-routing test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go Adjusts deploy-note concatenation to account for FormatNextForNote now including a leading newline.
cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/format.go Implements stacked Next: renderer and command highlighting via output.WithHighLightFormat.
cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/format_test.go Updates golden expectations, suppresses color globally for determinism, and adds highlight-selection coverage.

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/nextstep/format.go Outdated
Restyle the post-deploy (and show/init/doctor) "Next:" guidance block in
the azure.ai.agents extension. Each suggestion now renders as a command
line over its description line, indented under a standalone "Next:" header
with a blank line between suggestions, replacing the dense right-aligned
"cmd  -- desc" rows. Runnable azd commands are highlighted blue; "see ..."
and "edit agent.yaml: ..." pointers stay plain.

- format.go: stacked renderer plus highlightCommand helper; FormatNextForNote
  emits a leading blank line and drops the 4-space continuation pre-indent.
- service_target_agent.go: join the appended Next: block with a single
  newline since the block now carries its own leading newline.
- format_test.go: new layout goldens, TestMain color suppression, and a
  highlight-routing test.
@therealjohn therealjohn force-pushed the johmil/agent-nextstep-stacked-format branch from 06130cf to 168fd8a Compare June 19, 2026 20:55
@trangevi trangevi enabled auto-merge (squash) June 19, 2026 21:07
Address Copilot PR review: highlightCommand applied color via
output.WithHighLightFormat, which only self-gates on NO_COLOR/non-TTY --
not azd's --output json mode. Because FormatNextForNote's result is
embedded in an artifact note that azd serializes into
`azd deploy --output json`, and the service-target Deploy path has no
output-format signal, color could leak ANSI escape codes into JSON.

Plumb an explicit colorize signal from call sites: PrintNext/PrintAllNext
take a colorize bool (terminal call sites pass true; doctor threads its
TTY-derived showNext), while FormatNextForNote always renders plain. Fix
the inaccurate doc comment that claimed WithHighLightFormat self-disables
for JSON.

Add regression tests asserting FormatNextForNote never emits ANSI even
with color enabled, and that the terminal path highlights only azd
commands.
@therealjohn therealjohn disabled auto-merge June 19, 2026 21:26
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.

azure.ai.agents: post-deploy Next: guidance block is dense and hard to read

3 participants