chore(a2a-server): if a2a task creation fails return error to user (#8106)

Co-authored-by: cornmander <shikhman@google.com>
This commit is contained in:
Adam Weidman
2025-09-10 12:08:58 -04:00
committed by GitHub
parent 50e7c88aa4
commit bd0f085ae8
4 changed files with 91 additions and 15 deletions
+15 -2
View File
@@ -7,14 +7,17 @@
import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest';
import request from 'supertest';
import type express from 'express';
import { createApp, updateCoderAgentCardUrl } from './app.js';
import * as fs from 'node:fs';
import * as path from 'node:path';
import * as os from 'node:os';
import type { Server } from 'node:http';
import type { TaskMetadata } from '../types.js';
import type { AddressInfo } from 'node:net';
import { createApp, updateCoderAgentCardUrl } from './app.js';
import type { TaskMetadata } from '../types.js';
import { createMockConfig } from '../utils/testing_utils.js';
import type { Config } from '@google/gemini-cli-core';
// Mock the logger to avoid polluting test output
// Comment out to help debug
vi.mock('../utils/logger.js', () => ({
@@ -56,6 +59,16 @@ vi.mock('../agent/task.js', () => {
return { Task: MockTask };
});
vi.mock('../config/config.js', async () => {
const actual = await vi.importActual('../config/config.js');
return {
...actual,
loadConfig: vi
.fn()
.mockImplementation(async () => createMockConfig({}) as Config),
};
});
describe('Agent Server Endpoints', () => {
let app: express.Express;
let server: Server;