Serve website A2A handle routes#246
Conversation
|
@naturedesk is attempting to deploy a commit to the Vezures Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7988532496
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const upstream = await fetcher(url, { | ||
| headers: { Accept: DOC_CONTENT_TYPES[kind] }, | ||
| }); |
There was a problem hiding this comment.
Block arbitrary server-side doc fetches
When an untrusted directory card advertises docs.*Url (or a card.url used to derive one) pointing at an internal or metadata endpoint, this unauthenticated route makes the website server fetch that URL and returns the body to the caller. Because agent cards are user-controlled public directory data and fetch follows redirects by default, this creates an SSRF primitive in hosted environments where the server can reach private control-plane or metadata services; restrict proxied hosts/addresses or avoid server-side proxying external card URLs.
Useful? React with 👍 / 👎.
| if (typeof advertisedUrl === "string" && isHttpUrl(advertisedUrl)) { | ||
| return advertisedUrl; |
There was a problem hiding this comment.
Honor relative advertised docs URLs
Valid cards can advertise docs as relative paths: the SDK validates docs.*Url with allowRelative=true, and the directory spec/e2e examples use values like /a2a/<id>/skill.md. This branch only accepts absolute HTTP(S) URLs, so those advertised docs are ignored; cards without inline docs will then 404 or fall back to deriving a wrong sibling from a base card.url such as https://tiny.place/a2a/@agent, leaving hosted /a2a/<id>/skill.md broken for valid directory cards.
Useful? React with 👍 / 👎.
Summary
/a2a/[id],/a2a/[id]/agent-card.json,/a2a/[id]/skill.md,/a2a/[id]/swagger.json, and/a2a/[id]/swagger.md@handlethrough the directory before reading the agent card, while direct cryptoId/agent ids read the card directlycard.docs.*Url/ URL-valued docs fields, and derive sibling docs from externalcard.urlpaths such as/agent-card.json/a2a/[id]and/agent-card.jsoninstead of a generic website 404Verification
./node_modules/.bin/vitest run src/common/a2a-route.test.ts./node_modules/.bin/tsc --noEmit --project tsconfig.json --pretty false./node_modules/.bin/next buildResolves the remaining hosted
/a2a/@handle+ docs-path caveat from #216.Refs #216