Commit dad53e9
authored
Stack the azure.ai.agents
* Stack agent "Next:" guidance with indentation and command highlighting
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.
* Add CHANGELOG entry for #8731
* Keep Next: artifact note plain to avoid ANSI in --output json
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.
* Restore Next: command highlighting in terminal output
Revert the unconditional plain-note change (047b6ff) so the post-deploy
Next: block highlights azd commands again in regular (color) terminal
mode. Highlighting follows the host's color state: azd core sets
FORCE_COLOR for the extension only when core itself is in color mode
(interactive TTY, NO_COLOR unset), so piped/redirected/NO_COLOR runs stay
plain.
Replace the inaccurate doc comment that claimed WithHighLightFormat
self-disables for --output json. It does not; document the actual
FORCE_COLOR-driven behavior and note the residual --output-json-on-a-TTY
gap (closing it fully needs a core change, and the common scripted JSON
case is non-TTY so it is already plain).Next: guidance block with command highlighting (#8731)1 parent b799477 commit dad53e9
4 files changed
Lines changed: 246 additions & 108 deletions
File tree
- cli/azd/extensions/azure.ai.agents
- internal
- cmd/nextstep
- project
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
Lines changed: 69 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | | - | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
72 | | - | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | | - | |
| 94 | + | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
106 | | - | |
107 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
| |||
162 | 169 | | |
163 | 170 | | |
164 | 171 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
173 | 175 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
182 | 180 | | |
183 | | - | |
184 | | - | |
| 181 | + | |
| 182 | + | |
185 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
0 commit comments