mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 14:23:02 -07:00
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.
This commit is contained in:
@@ -1593,6 +1593,14 @@ export class Config implements McpContext, AgentLoopContext {
|
||||
this.setModel(DEFAULT_GEMINI_MODEL_AUTO);
|
||||
}
|
||||
|
||||
// Fetch admin controls
|
||||
const experiments = await this.experimentsPromise;
|
||||
|
||||
const requestTimeoutMs = this.getRequestTimeoutMs();
|
||||
if (requestTimeoutMs !== undefined) {
|
||||
updateGlobalFetchTimeouts(requestTimeoutMs);
|
||||
}
|
||||
|
||||
const adminControlsEnabled =
|
||||
experiments?.flags[ExperimentFlags.ENABLE_ADMIN_CONTROLS]?.boolValue ??
|
||||
false;
|
||||
|
||||
Reference in New Issue
Block a user