fix(core): add keepAliveTimeout to no-proxy Agent for connection reuse

Match the proxy path's keepAliveTimeout: 60_000 so TCP connections to
local model servers survive between interactive turns (default 4s is
too short for 30s–2min prompt intervals).
This commit is contained in:
doudouOUC 2026-06-01 14:21:44 +08:00
parent fe6c8bd5d6
commit 436c41fb19
2 changed files with 2 additions and 0 deletions

View File

@ -86,6 +86,7 @@ describe('buildRuntimeFetchOptions (node runtime)', () => {
expect(dispatcher?.options).toMatchObject({
bodyTimeout: 0,
headersTimeout: 0,
keepAliveTimeout: 60_000,
});
});

View File

@ -181,6 +181,7 @@ function getOrCreateNoProxyDispatcher(bodyTimeout: number): Dispatcher {
const dispatcher = new Agent({
bodyTimeout,
headersTimeout: 0,
keepAliveTimeout: 60_000,
});
noProxyDispatcherCache.set(bodyTimeout, dispatcher);