Commit 493e5fa
fix(azure.ai.agents): doctor local checks — 3-of-3 review fix-ups (transport-error suggestions, unparseable-version message, version-agnostic Suggestion)
Three fix-ups from the 3-reviewer pass on ba365ab. All three are 3/3
consensus on the mechanic; the implementation chosen for each is the
reviewer-preferred shape (and minimally invasive).
G1 — transport-aware suggestion in checks 2 & 3 (was: GPT/Sonnet
"blocker", Opus "do not block, fix in checks 2/3 instead of with a
probe")
`azdext.NewAzdClient` constructs a *lazy* gRPC channel via
`grpc.NewClient`, so `deps.AzdClient != nil` cannot detect a
stale/unreachable `AZD_SERVER`. The transport failure first surfaces in
the next RPC — `Project().Get` in check 2, or `Environment().GetCurrent`
in check 3 — where the existing suggestions ("Run from a directory
containing azure.yaml, or `azd init`" / "Create one with `azd env new`")
are then actively wrong: they tell the user to fix project / env state
when the actual root cause is a broken channel.
Fix: a new `isTransportFailure(err)` helper inspects the gRPC status and
returns true for `codes.Unavailable` and `codes.DeadlineExceeded`.
Checks 2 and 3 swap the suggestion to "Re-run via `azd ai agent doctor`;
the extension cannot reach azd's gRPC channel." for transport-class
errors only. Server-side errors (`codes.NotFound`, `codes.Internal`,
etc.) keep the domain-specific suggestion. `codes.Canceled` is
user-initiated, not a transport failure.
Rejected: adding a dedicated probe RPC in check 1. Opus pointed out that
the probe adds latency to every doctor invocation, while the fix in
checks 2/3 achieves the same UX with zero extra RPCs.
S1 — distinguish "above floor" from "couldn't verify floor" (was: Sonnet
"blocker → Warn", GPT "Low → Warn", Opus "Low → Pass with distinguished
message")
When the extension version string is non-empty and non-"dev" but still
unparseable (e.g. "canary", "preview-beta-1", "1.2"), the previous code
fell through to the floor-pass branch with message `"azd extension
reachable (version canary)."` — indistinguishable from a genuinely-
above-floor pass.
Fix: call `parseMainVersion` explicitly in check 1 before the floor
compare. On parse failure, return `StatusPass` with a distinguished
message ("floor check skipped: version string not parseable") and
`Details["floorChecked"] = false`. Preserves the fail-open philosophy
(no nagging Warn on a build-label drift) while killing the false-green:
JSON consumers can detect the inconclusive case via the Details bit.
Rejected: Sonnet's StatusWarn proposal. Build labels that don't match
strict semver are not user errors — surfacing them as Warnings would
nag a long tail of legitimate non-standard build strings.
O1 — drop hard-coded "1.24.0" from the nil-client Suggestion (was: Opus
"Low", Sonnet "confirm Low", GPT "confirm Low")
The old Suggestion told users to "ensure azd is at least 1.24.0", but
the extension declares its actual floor in extension.yaml
(`requiredAzdVersion: ">1.23.13"`) and `go.mod` pins azd v1.23.14. A
user on 1.23.14 would have been told to perform an unneeded upgrade.
Fix: drop the version claim entirely. The Suggestion is now
version-agnostic ("Run the extension via `azd ai agent doctor` rather
than launching the extension binary directly.") so it cannot drift from
the extension's declared floor again. Test pins the version-agnostic
contract via `require.NotContains(t, got.Suggestion, "1.24.0")`.
Rejected (S2 — hardcoded `"local.azure-yaml"` ID in cascade-skip): 1/3
votes. GPT and Opus both rejected it as a maintainability preference,
not a defect; deferred indefinitely.
Net: +3 tests (transport-error swap in check 2 with 2 subcases,
transport-error swap in check 3, unparseable-version pass with 3 ver
subcases) + 1 helper test (`TestIsTransportFailure` with 7 subcases,
including the Canceled-is-not-transport boundary case). Existing
`TestCheckGRPCAndVersion_NoClient_Fails` pins the version-agnostic
contract for O1.
Pre-flight clean: gofmt, vet, build, doctor 8.8s (was 5.5s), full
extension suite green (cmd 16.0s, doctor 5.2s, nextstep 6.2s, others
unchanged), golangci-lint 0 issues, cspell 0 issues.
Per workflow precedent (2.4.1, 2.5.1, 2.6.5, 4.1.1, 4.1.2), trivial
3/3-consensus fix-ups skip a second review pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 2c08fc7 commit 493e5fa
2 files changed
Lines changed: 173 additions & 3 deletions
Lines changed: 55 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | | - | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
88 | 107 | | |
89 | 108 | | |
90 | 109 | | |
| |||
132 | 151 | | |
133 | 152 | | |
134 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
135 | 163 | | |
136 | 164 | | |
137 | 165 | | |
138 | | - | |
| 166 | + | |
139 | 167 | | |
140 | 168 | | |
141 | 169 | | |
| |||
188 | 216 | | |
189 | 217 | | |
190 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
191 | 223 | | |
192 | 224 | | |
193 | 225 | | |
194 | | - | |
| 226 | + | |
195 | 227 | | |
196 | 228 | | |
197 | 229 | | |
| |||
213 | 245 | | |
214 | 246 | | |
215 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
216 | 268 | | |
217 | 269 | | |
218 | 270 | | |
| |||
Lines changed: 118 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
| 190 | + | |
| 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 | + | |
| 217 | + | |
187 | 218 | | |
188 | 219 | | |
189 | 220 | | |
| |||
246 | 277 | | |
247 | 278 | | |
248 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
249 | 316 | | |
250 | 317 | | |
251 | 318 | | |
| |||
336 | 403 | | |
337 | 404 | | |
338 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
339 | 427 | | |
340 | 428 | | |
341 | 429 | | |
| |||
424 | 512 | | |
425 | 513 | | |
426 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
0 commit comments