Skip to content

fix(registry): probe the A2A agent card at /.well-known/agent-card.json - #8978

Merged
bokelley merged 1 commit into
adcontextprotocol:mainfrom
KonstantinMirin:fix/registry-a2a-agent-card-path
Nov 18, 2026
Merged

bokelley merged 1 commit into
adcontextprotocol:mainfrom
KonstantinMirin:fix/registry-a2a-agent-card-path

Conversation

@KonstantinMirin

Copy link
Copy Markdown
Collaborator

Part of #7875.

The well-known location of the A2A agent card is /.well-known/agent-card.json (A2A §8.2). Agents don't serve /.well-known/agent.json, and clients don't need to probe it. The registry server fetched only agent.json, so an agent that serves its card at the A2A path showed "A2A agent card not found" on its health check and was never listed as A2A by the discovery endpoints.

Changes

  • New server/src/lib/a2a-agent-card.ts: A2A_AGENT_CARD_PATH and hasA2AAgentCard(url), which fetches the card at the origin of url through sdkSafeFetch and returns whether it answered 2xx.
  • server/src/http.ts (/api/discover-agent) and server/src/routes/registry-api.ts (/api/public/discover-agent) each had the same inline agent.json probe. Both now call hasA2AAgentCard, the same way they share inferDiagnosticAgentType.
  • server/src/health.ts: the A2A health check fetches ${agent.url}/.well-known/agent-card.json, and the wrong_path hint names that path. The health check still resolves the path against the agent URL, as before; only the file name changed.
  • tests/sdk-safe-fetch-callsites.test.ts: the guard that A2A probes don't use ambient fetch now checks that both endpoints call hasA2AAgentCard and that the helper calls sdkSafeFetch.

No other code under server/ probes agent.json. adagents-manager.ts already uses agent-card.json. No changeset: the change is server-only.

Tests

Each new test fails for one reason:

  • server/tests/unit/a2a-agent-card.test.ts: the helper requests only /.well-known/agent-card.json at the origin, returns true on 2xx, false on a non-2xx answer, and false when the request fails.
  • server/tests/unit/health-fallback.test.ts: an A2A agent that serves its card only at agent-card.json probes as online; the probe requests only that URL; the wrong_path hint names /.well-known/agent-card.json.
  • server/tests/unit/discover-agent-serializer.test.ts: /api/public/discover-agent lists ["mcp", "a2a"] when the origin serves agent-card.json.

Testing

All run in a clean worktree off origin/main at a2a7d20, on Node 24.21.0:

  • npx vitest run --config server/vitest.config.ts server/tests/unit/a2a-agent-card.test.ts server/tests/unit/health-fallback.test.ts server/tests/unit/discover-agent-serializer.test.ts: 30 of 30 pass.
  • With health.ts and registry-api.ts reverted to main and the tests kept, the four new health and discover-agent tests fail and the 22 existing ones pass.
  • npm run typecheck: passes.
  • node scripts/check-changeset-protocol-scope.cjs origin/main: passes, no protocol-scoped changes.
  • The pre-commit hook (root unit tests, the full server unit suite, typecheck) passed.

The health check and both discover-agent endpoints fetched only
/.well-known/agent.json, so an agent that serves its card at the A2A
well-known URI showed "A2A agent card not found" and was never listed as
A2A. Probe /.well-known/agent-card.json only, through one shared helper,
and point the wrong_path hint at the same path.

Part of adcontextprotocol#7875.
@mintlify

mintlify Bot commented Nov 13, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 0c022af.

Approve preview

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean server-only refactor with no blocking findings.

This PR consolidates three duplicated inline A2A agent-card probes into a single hasA2AAgentCard helper and corrects the probed well-known URI from the pre-1.0 /.well-known/agent.json to the A2A §8.2 standard /.well-known/agent-card.json (#7875). Migration is complete across health.ts/http.ts/registry-api.ts; URL resolution, the 3s timeout, SSRF-safe sdkSafeFetch, and fail-closed error handling are all preserved. No schema/dist artifacts touched, and no changeset is correctly omitted (server-only change, out of published protocol surface). Tests cover all three call sites plus the helper.

Decision table walk-through:

  • Rows 1: no critical/high findings.
  • Row 2: gated_paths is false — does not fire despite review_decision being REVIEW_REQUIRED.
  • Row 3: high_risk is true but the only matching reason is a (modified) file, not (deleted).
  • Rows 4-5: no medium findings at all.
  • Rows 6-8: no prior escalation, no no-auto-approve team match, zero medium findings.
  • Row 9: approve.

The high_risk flag fires on server/src/routes/registry-api.ts (modified, matching server/src/routes/**), but the reviewer found no medium-or-higher concerns on that modification, so it is presumed safe. No breaking-class protocol change, no spec/docs surface touched — the breaking-change hard gate does not apply.

@bokelley
bokelley merged commit e74e541 into adcontextprotocol:main Nov 18, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants