Skip to content

perf(config): defer remote sandbox hostname lookup#28542

Merged
fcoury-oai merged 1 commit into
mainfrom
codex/lazy-remote-sandbox-hostname
Jun 16, 2026
Merged

perf(config): defer remote sandbox hostname lookup#28542
fcoury-oai merged 1 commit into
mainfrom
codex/lazy-remote-sandbox-hostname

Conversation

@fcoury-oai

Copy link
Copy Markdown
Contributor

Why

#18763 added canonical hostname resolution for remote_sandbox_config. Requirements composition currently performs that synchronous DNS lookup on every fresh process, even when none of the loaded requirements layers contains [[remote_sandbox_config]]. On hosts with slow local DNS resolution, this can add several seconds to Codex startup.

What

  • defer hostname resolution until a parsed requirements layer actually contains remote_sandbox_config
  • cache the resolver result once per requirements composition, preserving the existing single-lookup behavior across multiple layers
  • keep the existing FQDN resolution and per-layer requirements precedence unchanged
  • cover both the ordinary no-lookup path and the multi-layer single-lookup path

How to Test

On a host where local canonical-name resolution is slow:

  1. Start Codex without [[remote_sandbox_config]] in any managed requirements layer and confirm startup no longer waits for hostname resolution.
  2. Add a matching [[remote_sandbox_config]] entry and confirm its allowed_sandbox_modes still overrides the layer's top-level value.
  3. Add remote sandbox entries to multiple requirements layers and confirm precedence remains unchanged while the hostname is resolved only once.

Targeted tests:

  • just test -p codex-config hostname_resolver
  • just test -p codex-config (181 passed)

@fcoury-oai
fcoury-oai force-pushed the codex/lazy-remote-sandbox-hostname branch from 7d108d1 to 136d59d Compare June 16, 2026 14:51
@fcoury-oai
fcoury-oai merged commit 40e7dda into main Jun 16, 2026
45 of 47 checks passed
@fcoury-oai
fcoury-oai deleted the codex/lazy-remote-sandbox-hostname branch June 16, 2026 15:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants