fix: reduce ConfigBuilder::build stack usage (#20650)

## Why

`ConfigBuilder::build` performs a large amount of async config loading.
Leaving that entire future on the caller stack makes config startup more
fragile on small runtime worker stacks.

## What changed

- keep `ConfigBuilder::build` as a thin wrapper that boxes the
config-loading future before awaiting it
- move the existing implementation into a private `build_inner` method
so the large async state machine lives on the heap instead of the
runtime thread stack

## Testing

- Not run locally
This commit is contained in:
jif-oai
2026-05-01 20:24:17 +02:00
committed by GitHub
Unverified
parent ff66b3c7eb
commit 2817866a32
+5
View File
@@ -923,6 +923,11 @@ impl ConfigBuilder {
}
pub async fn build(self) -> std::io::Result<Config> {
// 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<Config> {
let Self {
codex_home,
cli_overrides,