Commit 14d294c
feat(a2a): add public_url param to agent card for production deployments (#621)
* feat(a2a): add public_url param to agent card for production deployments
Fixes #616
Adds `public_url` to `_build_agent_card`, `create_a2a_server`, `serve`,
and `ServeConfig` so adopters running behind a load balancer or reverse
proxy can advertise the correct public URL in `/.well-known/agent-card.json`
instead of leaking `http://localhost:{port}/`.
Also checks the `PUBLIC_URL` environment variable as a zero-code-change
fallback for Cloud Run / Fly.io / Railway deployments.
https://claude.ai/code/session_01NXgGie4ARyxg3hWBYo5tG6
* fix(a2a): address pre-PR review findings for public_url
- Add public_url docstring to serve() (was missing despite being present in create_a2a_server)
- Normalise trailing slash so callers can pass "https://x.com" or "https://x.com/"
- Remove redundant `or None` from resolved_public_url assignment
- Remove dead handler_ref loop from test
https://claude.ai/code/session_01NXgGie4ARyxg3hWBYo5tG6
* test(a2a): add missing public_url edge case tests
- Assert trailing-slash normalisation (URL without trailing slash)
- Assert create_a2a_server defaults to localhost when PUBLIC_URL unset
https://claude.ai/code/session_01NXgGie4ARyxg3hWBYo5tG6
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2989101 commit 14d294c
3 files changed
Lines changed: 148 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
| 671 | + | |
671 | 672 | | |
672 | 673 | | |
673 | 674 | | |
| |||
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
706 | | - | |
| 707 | + | |
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
| |||
759 | 760 | | |
760 | 761 | | |
761 | 762 | | |
| 763 | + | |
762 | 764 | | |
763 | 765 | | |
764 | 766 | | |
| |||
854 | 856 | | |
855 | 857 | | |
856 | 858 | | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
857 | 872 | | |
858 | 873 | | |
859 | 874 | | |
860 | 875 | | |
861 | 876 | | |
| 877 | + | |
862 | 878 | | |
863 | 879 | | |
864 | 880 | | |
| |||
881 | 897 | | |
882 | 898 | | |
883 | 899 | | |
| 900 | + | |
884 | 901 | | |
885 | 902 | | |
886 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
533 | 534 | | |
534 | 535 | | |
535 | 536 | | |
| 537 | + | |
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
| |||
714 | 716 | | |
715 | 717 | | |
716 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
717 | 731 | | |
718 | 732 | | |
719 | 733 | | |
| |||
763 | 777 | | |
764 | 778 | | |
765 | 779 | | |
| 780 | + | |
766 | 781 | | |
767 | 782 | | |
768 | 783 | | |
| |||
804 | 819 | | |
805 | 820 | | |
806 | 821 | | |
| 822 | + | |
807 | 823 | | |
808 | 824 | | |
809 | 825 | | |
| |||
856 | 872 | | |
857 | 873 | | |
858 | 874 | | |
| 875 | + | |
859 | 876 | | |
860 | 877 | | |
861 | 878 | | |
| |||
1386 | 1403 | | |
1387 | 1404 | | |
1388 | 1405 | | |
| 1406 | + | |
1389 | 1407 | | |
1390 | 1408 | | |
1391 | 1409 | | |
| |||
1410 | 1428 | | |
1411 | 1429 | | |
1412 | 1430 | | |
| 1431 | + | |
1413 | 1432 | | |
1414 | 1433 | | |
1415 | 1434 | | |
| |||
1469 | 1488 | | |
1470 | 1489 | | |
1471 | 1490 | | |
| 1491 | + | |
1472 | 1492 | | |
1473 | 1493 | | |
1474 | 1494 | | |
| |||
1557 | 1577 | | |
1558 | 1578 | | |
1559 | 1579 | | |
| 1580 | + | |
1560 | 1581 | | |
1561 | 1582 | | |
1562 | 1583 | | |
| |||
1645 | 1666 | | |
1646 | 1667 | | |
1647 | 1668 | | |
| 1669 | + | |
1648 | 1670 | | |
1649 | 1671 | | |
1650 | 1672 | | |
| |||
1691 | 1713 | | |
1692 | 1714 | | |
1693 | 1715 | | |
| 1716 | + | |
1694 | 1717 | | |
1695 | 1718 | | |
1696 | 1719 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 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 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
334 | 440 | | |
335 | 441 | | |
336 | 442 | | |
| |||
0 commit comments