-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(a2a): added file data part and data data part to a2a agents #2805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR enhances A2A agent communication by adding support for Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant SendMessageAPI
participant A2AUtils
participant A2AClient
participant ExternalAgent
Client->>SendMessageAPI: POST /api/tools/a2a/send-message
Note over Client,SendMessageAPI: {agentUrl, message, data, files, apiKey}
SendMessageAPI->>SendMessageAPI: Validate request (Zod schema)
SendMessageAPI->>SendMessageAPI: Parse data field (JSON)
SendMessageAPI->>SendMessageAPI: Process files (URL/base64)
SendMessageAPI->>A2AUtils: createA2AClient(agentUrl, apiKey)
A2AUtils->>ExternalAgent: GET /.well-known/agent.json
alt Standard A2A path succeeds
ExternalAgent-->>A2AUtils: Agent card
else Standard path fails
A2AUtils->>ExternalAgent: GET {agentUrl} (root URL)
ExternalAgent-->>A2AUtils: Agent card
end
A2AUtils-->>SendMessageAPI: A2A Client
SendMessageAPI->>SendMessageAPI: Build Message with Parts
Note over SendMessageAPI: TextPart + DataPart + FilePart[]
SendMessageAPI->>A2AClient: sendMessage({message})
A2AClient->>ExternalAgent: Send A2A message
alt Response is Message
ExternalAgent-->>A2AClient: Message response
A2AClient-->>SendMessageAPI: Message object
SendMessageAPI->>SendMessageAPI: Extract text content
SendMessageAPI-->>Client: {content, taskId, state: "completed"}
else Response is Task
ExternalAgent-->>A2AClient: Task response
A2AClient-->>SendMessageAPI: Task object
SendMessageAPI->>SendMessageAPI: Extract last agent message
SendMessageAPI-->>Client: {content, taskId, state, artifacts, history}
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (3)
-
apps/sim/app/api/tools/a2a/send-message-stream/route.ts, line 65-72 (link)logic: message construction doesn't include
DataPartandFilePartlogic that was added to non-streaming endpointThe implementation needs to match
/api/tools/a2a/send-message/route.tslines 78-136 -
apps/sim/app/api/tools/a2a/send-message-stream/route.ts, line 20-26 (link)logic: streaming endpoint missing
dataandfilessupportThe schema needs to be updated to match the non-streaming endpoint (
/api/tools/a2a/send-message/route.tslines 13-28). AddFileInputSchema, and includedataandfilesfields in the validation schema. -
apps/sim/tools/a2a/send_message_stream.ts, line 10-33 (link)logic: tool params missing
dataandfilesfields that were added toa2aSendMessageTool
16 files reviewed, 3 comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, 1 comment
Summary
.well-knownpath that adheres to the A2A protocolType of Change
Testing
Tested manually
Checklist