Reduce the default thread unload delay to one minute (#57242)

## What changed

Change the default `thread_unload_delay_secs` from 1800 to 60 seconds. App-server threads become eligible for unloading after one minute with no subscribers and no activity. Update the configuration documentation, schema, and thread manager sample to match.

## Testing

Update the configuration test to cover the 60-second default, zero for immediate unloading, and an explicit 1800-second override.

GitOrigin-RevId: 0da8454eb25a6ef4b7e3665601982d2e0c183f7c
This commit is contained in:
jif
2026-10-26 20:44:30 +00:00
committed by copyberry
parent b881730487
commit db7516f41b
5 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -258,9 +258,9 @@ async fn load_config_applies_optional_mcp_startup_grace() -> std::io::Result<()>
async fn load_config_resolves_thread_unload_delay() -> anyhow::Result<()> {
let codex_home = tempdir()?;
for (toml, seconds) in [
("", 1800),
("", 60),
("thread_unload_delay_secs = 0", 0),
("thread_unload_delay_secs = 60", 60),
("thread_unload_delay_secs = 1800", 1800),
] {
let config = Config::load_from_base_config_with_overrides(
toml::from_str(toml)?,
+1 -1
View File
@@ -4122,7 +4122,7 @@ impl Config {
.unwrap_or(DEFAULT_MAX_BACKGROUND_TERMINAL_TIMEOUT_MS)
.max(MIN_EMPTY_YIELD_TIME_MS);
let thread_unload_delay =
Duration::from_secs(cfg.thread_unload_delay_secs.unwrap_or(/*default*/ 1800));
Duration::from_secs(cfg.thread_unload_delay_secs.unwrap_or(/*default*/ 60));
if std::time::Instant::now()
.checked_add(thread_unload_delay)
.is_none()