mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-08 00:57:16 -07:00
fix: resolve agent card URL for A2A client initialization
ClientFactory.createFromUrl expects the full agent card URL (/.well-known/agent-card.json), not just the base server URL. Also adds CHAT_BRIDGE_A2A_URL to k8s deployment and test script.
This commit is contained in:
@@ -87,9 +87,10 @@ export function extractAllParts(result: A2AResponse): Part[] {
|
||||
export function extractTextFromParts(parts: Part[]): string {
|
||||
return parts
|
||||
.filter((p) => p.kind === 'text')
|
||||
.map((p) =>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
(p as unknown as { text: string }).text
|
||||
.map(
|
||||
(p) =>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
(p as unknown as { text: string }).text,
|
||||
)
|
||||
.filter(Boolean)
|
||||
.join('\n');
|
||||
@@ -151,7 +152,10 @@ export class A2ABridgeClient {
|
||||
);
|
||||
|
||||
const factory = new ClientFactory(options);
|
||||
this.client = await factory.createFromUrl(this.agentUrl, '');
|
||||
// createFromUrl expects the agent card URL, not just the base URL
|
||||
const agentCardUrl =
|
||||
this.agentUrl.replace(/\/$/, '') + '/.well-known/agent-card.json';
|
||||
this.client = await factory.createFromUrl(agentCardUrl, '');
|
||||
|
||||
const card = await this.client.getAgentCard();
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user