Handle upstream stream drops
All checks were successful
build / test (push) Successful in 29s

This commit is contained in:
2026-05-23 12:20:22 -04:00
parent 45e12324df
commit 2fd97d8d09
3 changed files with 224 additions and 29 deletions

View File

@@ -28,6 +28,10 @@ export interface GatewayOptions {
agents?: EnabledAgent[];
/** Override the bearer token (otherwise read from ~/.a2a/credentials.json). */
token?: string | null;
/** Test/advanced override for one-shot upstream JSON-RPC calls. */
upstreamRequestTimeoutMs?: number;
/** Test/advanced override for idle SSE upstream tools/call streams. */
upstreamStreamIdleTimeoutMs?: number;
/** Optional override for the underlying MCP Server (tests). */
server?: Server;
}
@@ -56,6 +60,8 @@ export async function buildGateway(opts: GatewayOptions = {}): Promise<GatewayHa
new UpstreamAgent({
name: a.name, url: a.url, token,
cpJwt, cpUrl, bucket,
requestTimeoutMs: opts.upstreamRequestTimeoutMs,
streamIdleTimeoutMs: opts.upstreamStreamIdleTimeoutMs,
}),
);
}