diff --git a/codex-rs/core/src/config/mod.rs b/codex-rs/core/src/config/mod.rs index 4b55da026..20b2a923f 100644 --- a/codex-rs/core/src/config/mod.rs +++ b/codex-rs/core/src/config/mod.rs @@ -923,6 +923,11 @@ impl ConfigBuilder { } pub async fn build(self) -> std::io::Result { + // Keep the large config-loading future off small runtime thread stacks. + Box::pin(self.build_inner()).await + } + + async fn build_inner(self) -> std::io::Result { let Self { codex_home, cli_overrides,