Skip to content

Commit f9006c4

Browse files
committed
feat(core): use experiment flags for default fetch timeouts
Replaces hardcoded fetch timeouts in `undici`'s Agent and ProxyAgent with newly defined experiment flags `DEFAULT_REQUEST_TIMEOUT` and `DEFAULT_TOTAL_REQUEST_TIMEOUT`. This allows for remote configuration of request timeouts. - Added `DEFAULT_REQUEST_TIMEOUT` and `DEFAULT_TOTAL_REQUEST_TIMEOUT` to `ExperimentFlags`. - Updated `fetch.ts` to use `DEFAULT_REQUEST_TIMEOUT` for headers and body timeouts. - Added unit tests to verify `setGlobalProxy` correctly applies the timeout flags.
1 parent e77b22e commit f9006c4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/core/src/config/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,14 @@ export class Config implements McpContext, AgentLoopContext {
15931593
this.setModel(DEFAULT_GEMINI_MODEL_AUTO);
15941594
}
15951595

1596+
// Fetch admin controls
1597+
const experiments = await this.experimentsPromise;
1598+
1599+
const requestTimeoutMs = this.getRequestTimeoutMs();
1600+
if (requestTimeoutMs !== undefined) {
1601+
updateGlobalFetchTimeouts(requestTimeoutMs);
1602+
}
1603+
15961604
const adminControlsEnabled =
15971605
experiments?.flags[ExperimentFlags.ENABLE_ADMIN_CONTROLS]?.boolValue ??
15981606
false;

0 commit comments

Comments
 (0)