Commit f2528f1
feat(azure.ai.agents): qualify single-agent post-deploy
Fix B9 from issue Azure#7975 (lines 228-242). Pre-C6, `ResolveAfterDeploy`
stripped the agent name when there was exactly one agent service in
state, emitting:
Next: azd ai agent show -- verify the deployed agent is running
azd ai agent invoke '<payload>' -- send a sample request to the deployed agent
That output had two problems:
1. **`azd ai agent show` (no name)** runs interactive resolution that
relies on the user's terminal state. When the artifact note is
copy-pasted into a different project (or read days later when the
single-agent project may have grown a second agent), the unqualified
command picks the wrong target or prompts. The spec example at
lines 231-232 shows the qualified form even in the single-agent
case for exactly this copy-paste-safety reason.
2. **Description copy was generic** ("verify the deployed agent is
running" / "send a sample request to the deployed agent"). Per
spec lines 231-241 the descriptions are intentionally tighter and
identify which agent each row refers to in the multi-agent layout.
C6 changes:
- `ResolveAfterDeploy` now always emits service-qualified commands
regardless of `len(state.Services)`. The pre-C6 unqualified branch
is gone.
- Descriptions reshape:
* Single agent (`len(state.Services) == 1`):
`verify it's running` / `test the deployment`
* Multi-agent (`len(state.Services) >= 2`):
`verify <name> is running` / `test <name>`
- Multi-agent layout now groups all `show` lines first, then all
`invoke` lines (was interleaved per service). Matches spec example
at lines 238-241. Single-agent output is unchanged in layout —
with one service the pass-1/pass-2 split still produces show-then-
invoke order.
- README hint placement: in the new pass-2 invoke loop the per-agent
hint is emitted immediately after that agent's invoke line, so a
reader can scan rows top-to-bottom and find each agent's hint in
context. Single-agent placement is identical to pre-C6.
- `AfterDeployOpts.ForceQualified` is kept as a NO-OP for backward
compatibility. Callers (doctor.go line 239 passes it for filtered
states) still compile and produce identical output. The doc
comment is updated to mark it as a no-op and explain why
(the single-agent unqualified heuristic it overrode is gone).
Tests:
- `TestResolveAfterDeploy` rewritten — all single-agent expectations
now assert qualified commands (`azd ai agent show echo` /
`azd ai agent invoke echo '...'`) and per-spec descriptions.
- New subtest for multi-agent grouped ordering (shows-then-invokes)
asserts shows in service-declaration order, then invokes in the
same order, each row carrying the per-agent descriptive text.
- New subtest for README hint placement in the multi-agent layout
asserts the hint follows the invoke line for the service that
triggered it, even with the new grouped ordering.
- The two `ForceQualified` subtests are kept and rewritten as
backward-compat assertions — they now compare against the
no-opts baseline and prove the flag is a true no-op.
Caller impact:
- `doctor.go:235-239` passes `ForceQualified: totalServices > 1`.
Output is identical to its old behavior (totalServices==1 used
to emit unqualified; now emits qualified, but doctor's
filtered-state callsite always wanted qualified anyway — that's
literally the comment at the callsite).
Spec source: issue Azure#7975 lines 228-242 + the C6 row in the P5.1
commit plan.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>Next: block (P5.1 C6, fix B9)1 parent a93ff7f commit f2528f1
4 files changed
Lines changed: 147 additions & 70 deletions
File tree
- cli/azd/extensions/azure.ai.agents/internal/cmd
- nextstep
Lines changed: 7 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
235 | 227 | | |
236 | | - | |
| 228 | + | |
237 | 229 | | |
238 | 230 | | |
239 | | - | |
240 | 231 | | |
241 | 232 | | |
242 | 233 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
Lines changed: 59 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
423 | 425 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
438 | 451 | | |
439 | 452 | | |
440 | 453 | | |
441 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
442 | 457 | | |
443 | | - | |
444 | | - | |
445 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
446 | 467 | | |
447 | | - | |
448 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
449 | 471 | | |
450 | 472 | | |
451 | 473 | | |
| |||
456 | 478 | | |
457 | 479 | | |
458 | 480 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
| 481 | + | |
464 | 482 | | |
465 | | - | |
466 | 483 | | |
467 | 484 | | |
| 485 | + | |
468 | 486 | | |
469 | | - | |
470 | | - | |
471 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
472 | 490 | | |
473 | 491 | | |
474 | | - | |
475 | | - | |
| 492 | + | |
| 493 | + | |
476 | 494 | | |
477 | 495 | | |
478 | 496 | | |
| 497 | + | |
479 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
480 | 503 | | |
481 | 504 | | |
482 | 505 | | |
| |||
486 | 509 | | |
487 | 510 | | |
488 | 511 | | |
489 | | - | |
490 | | - | |
491 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
492 | 515 | | |
493 | 516 | | |
494 | | - | |
495 | | - | |
| 517 | + | |
| 518 | + | |
496 | 519 | | |
497 | 520 | | |
498 | 521 | | |
| |||
Lines changed: 52 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
719 | | - | |
| 719 | + | |
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
726 | | - | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
727 | 729 | | |
728 | 730 | | |
729 | | - | |
| 731 | + | |
730 | 732 | | |
731 | 733 | | |
732 | 734 | | |
733 | 735 | | |
734 | 736 | | |
735 | | - | |
736 | | - | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
737 | 741 | | |
738 | 742 | | |
739 | 743 | | |
740 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
741 | 748 | | |
742 | 749 | | |
743 | 750 | | |
| |||
746 | 753 | | |
747 | 754 | | |
748 | 755 | | |
749 | | - | |
750 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
751 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
752 | 780 | | |
753 | 781 | | |
754 | 782 | | |
| |||
770 | 798 | | |
771 | 799 | | |
772 | 800 | | |
773 | | - | |
| 801 | + | |
774 | 802 | | |
775 | 803 | | |
776 | 804 | | |
777 | 805 | | |
778 | 806 | | |
779 | | - | |
| 807 | + | |
780 | 808 | | |
781 | 809 | | |
782 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
783 | 815 | | |
784 | 816 | | |
785 | 817 | | |
786 | 818 | | |
787 | 819 | | |
| 820 | + | |
| 821 | + | |
788 | 822 | | |
789 | 823 | | |
790 | 824 | | |
791 | 825 | | |
792 | 826 | | |
793 | | - | |
| 827 | + | |
794 | 828 | | |
795 | 829 | | |
796 | 830 | | |
797 | 831 | | |
798 | 832 | | |
799 | 833 | | |
800 | | - | |
801 | | - | |
| 834 | + | |
| 835 | + | |
802 | 836 | | |
803 | 837 | | |
804 | 838 | | |
| |||
811 | 845 | | |
812 | 846 | | |
813 | 847 | | |
814 | | - | |
| 848 | + | |
815 | 849 | | |
816 | 850 | | |
817 | 851 | | |
| |||
820 | 854 | | |
821 | 855 | | |
822 | 856 | | |
823 | | - | |
824 | | - | |
| 857 | + | |
| 858 | + | |
825 | 859 | | |
826 | 860 | | |
827 | 861 | | |
| |||
0 commit comments