fix: robust UX for remote agent errors (#20307)

Co-authored-by: Adam Weidman <adamfweidman@google.com>
This commit is contained in:
Shyam Raghuwanshi
2026-03-11 05:20:25 +05:30
committed by GitHub
parent 12bf803d23
commit 7ef967de02
8 changed files with 768 additions and 32 deletions
@@ -302,7 +302,7 @@ describe('A2AClientManager', () => {
expect(call.message.taskId).toBe(expectedTaskId);
});
it('should throw prefixed error on failure', async () => {
it('should propagate the original error on failure', async () => {
sendMessageStreamMock.mockImplementationOnce(() => {
throw new Error('Network error');
});
@@ -312,9 +312,7 @@ describe('A2AClientManager', () => {
for await (const _ of stream) {
// consume
}
}).rejects.toThrow(
'[A2AClientManager] sendMessageStream Error [TestAgent]: Network error',
);
}).rejects.toThrow('Network error');
});
it('should throw an error if the agent is not found', async () => {