azure.ai.agents: deploy result links need a blank-line separator and column-0 alignment (requires core artifact-rendering support)
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 136
Description
## Summary
After a successful `azd up` / `azd deploy`, the `azure.ai.agents` extension surfaces result links (Agent playground, Agent endpoint) plus a `Next:` guidance block. The vertical spacing and horizontal alignment of this block are inconsistent and cannot be fixed from the extension alone -- a small core change is required.
Two specific issues:
1. There is no blank line separating the deploy status/progress table from the result links, so the links run directly into the table.
2. The result links are indented two spaces (under the command title), while the `Next:` block renders flush-left at column 0. The mismatch makes the links look "tabbed" relative to `Next:`.
This is a follow-up to #8730 / #8731, which restyled the `Next:` block itself but did not address the spacing/alignment of the surrounding links.
## Current behavior
```
Service Status Duration
------------------ ------------ ----------
* Done 3m15s
- Agent playground (portal): https://...
- Agent endpoint (responses): https://...
Next:
azd ai agent show
verify it's running
```
- No blank line between the table and `- Agent playground ...`.
- Links indented two spaces; `Next:` header at column 0 (misaligned).
## Desired behavior
```
Service Status Duration
------------------ ------------ ----------
* Done 3m15s
- Agent playground (portal): https://...
- Agent endpoint (responses): https://...
Next:
azd ai agent show
verify it's running
```
- A blank line before the first link.
- Links aligned at column 0, consistent with the `Next:` header.
## Root cause
The links are produced by the extension as `Artifact` objects and returned over gRPC (`ServiceDeployResult.Artifacts`). They are rendered by **core azd**, not the extension:
- `cli/azd/pkg/project/artifact.go` -- `Artifact.ToString(currentIndentation)` builds each endpoint line as `currentIndentation + "- " + label + ": " + url`. The indent prefix and line structure are fixed by core.
- `ArtifactCollection.ToString` concatenates artifact outputs with no separators between them.
- The render call sites are `cli/azd/internal/cmd/up_graph.go` and `cli/azd/internal/cmd/deploy.go`, which call `console.MessageUxItem(ctx, dr.Artifacts)` at the active console indent (two spaces).
- The `Next:` block lands at column 0 only because it is carried in the artifact `note` metadata, and core renders note continuation lines flush-left.
The extension only supplies field values (label, url, note, clickable) that are embedded mid-line. It cannot:
- prepend a blank line before the first artifact (nothing precedes the first link to attach a note to), or
- change the indent of the rendered link line.
So both fixes require core support. Note that this rendering path is shared by every service target (Container Apps, App Service, Functions, AKS, Static Web Apps, AI endpoint, agents), so any change must avoid regressing non-agent output.
## Proposed core change (opt-in, extension-driven)
Add generic, opt-in artifact-metadata keys that core honors only when an artifact sets them -- mirroring the existing `clickable` / `note` / `label` / `discriminator` metadata pattern. Other service targets that do not set the keys keep their current output unchanged.
Suggested keys:
- `leadingBlankLine` (bool) -- when set on an artifact, `Artifact.ToString` (or `ArtifactCollection.ToString`) emits one blank line before that artifact.
- An indent override (e.g. `indent: "none"`) -- when set, the artifact's line renders at column 0 instead of inheriting the console indent.
The `azure.ai.agents` extension would then set these keys on its endpoint artifacts so the result links get a leading blank line and align with the `Next:` block.
## Affected files
- Core: `cli/azd/pkg/project/artifact.go` (rendering + metadata key constants), with coverage in `cli/azd/pkg/project/artifact_test.go`.
- Extension: `cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go` (`deployArtifacts`) to set the new metadata.
## Sequencing
Per the extension contribution guide, this lands as two PRs:
1. Core PR adding the opt-in metadata capability.
2. Extension PR that picks up the new core version and sets the metadata.
## Acceptance criteria
- A blank line separates the deploy status table from the result links in `azd up` / `azd deploy` output for agents.
- Agent result links align at column 0 with the `Next:` header.
- Output for all non-agent service targets is unchanged (keys are opt-in).
Contributor guide
Assessment
This issue has not been assessed yet.