fix(a2a): added file data part and data data part to a2a agents#2805
fix(a2a): added file data part and data data part to a2a agents#2805waleedlatif1 merged 3 commits intostagingfrom
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.
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
|
@greptile |
Summary
.well-knownpath that adheres to the A2A protocolType of Change
Testing
Tested manually
Checklist