Skip to content

Commit 85c313c

Browse files
authored
fix(a2a-middleware): Remove 'A2A Agent Response:' prefix from tool result messages (#502)
The A2A middleware was adding an "A2A Agent Response: " prefix to tool result messages stored in conversation history (line 157). This prefix broke JSON parsing when the orchestrator agent received these tool results, causing "Invalid JSON: Expecting value: line 1 column 1" errors. The tool result content should contain the raw response from the A2A agent, not a prefixed version. The event content (line 172) was already correct. This fix ensures tool results can be properly parsed by orchestrator agents, particularly when using ADK agents that expect valid JSON responses. Fixes JSON parsing errors in orchestrator agents receiving A2A tool results.
1 parent f21ac0e commit 85c313c

File tree

1 file changed

+1
-1
lines changed
  • typescript-sdk/integrations/a2a-middleware/src

1 file changed

+1
-1
lines changed

typescript-sdk/integrations/a2a-middleware/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class A2AMiddlewareAgent extends AbstractAgent {
154154
id: randomUUID(),
155155
role: "tool",
156156
toolCallId: toolCallId,
157-
content: `A2A Agent Response: ${a2aResponse}`,
157+
content: a2aResponse,
158158
};
159159
if (this.debug) {
160160
console.debug("newMessage From a2a agent", newMessage);

0 commit comments

Comments
 (0)