Skip to content

inline hostname resolution for remote sandbox config#19739

Merged
abhinav-oai merged 4 commits intomainfrom
abhinav/lazy-remote-sandbox-hostname
Apr 27, 2026
Merged

inline hostname resolution for remote sandbox config#19739
abhinav-oai merged 4 commits intomainfrom
abhinav/lazy-remote-sandbox-hostname

Conversation

@abhinav-oai
Copy link
Copy Markdown
Collaborator

@abhinav-oai abhinav-oai commented Apr 27, 2026

Why

Requirements support host-specific remote_sandbox_config.hostname_patterns, but config loading previously resolved and passed the system hostname through every config-loading path even when no requirements layer used remote_sandbox_config. On machines where hostname lookup is slow, startup and app-server config reads paid for a feature that was not active.

We only need the hostname when a requirements layer actually declares remote_sandbox_config, so this moves hostname resolution to the single requirements merge point and keeps all other config callers unaware of hostname matching.

What

  • Removed the eager host_name plumbing from load_config_layers_state, load_requirements_toml, ConfigBuilder, app-server ConfigManager, network proxy loading, and related call sites.
  • Resolve the hostname inside merge_requirements_with_remote_sandbox_config only when the incoming requirements contain remote_sandbox_config.

@abhinav-oai abhinav-oai force-pushed the abhinav/lazy-remote-sandbox-hostname branch from 7def644 to cdc42b2 Compare April 27, 2026 01:24
@abhinav-oai abhinav-oai changed the title [codex] Lazily resolve remote sandbox hostname Lazily resolve remote sandbox hostname Apr 27, 2026
@abhinav-oai abhinav-oai changed the title Lazily resolve remote sandbox hostname Lazily resolve hostname for remote sandbox config Apr 27, 2026
@abhinav-oai abhinav-oai marked this pull request as ready for review April 27, 2026 02:15
@abhinav-oai abhinav-oai requested a review from a team as a code owner April 27, 2026 02:15
@abhinav-oai abhinav-oai force-pushed the abhinav/lazy-remote-sandbox-hostname branch from cdc42b2 to b9b7d40 Compare April 27, 2026 02:19
@abhinav-oai abhinav-oai force-pushed the abhinav/lazy-remote-sandbox-hostname branch from b9b7d40 to 4e2f477 Compare April 27, 2026 02:20
) {
requirements.apply_remote_sandbox_config(host_name);
if requirements.remote_sandbox_config.is_some() {
let host_name = crate::host_name();
Copy link
Copy Markdown
Collaborator Author

@abhinav-oai abhinav-oai Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically just inlined it here

@abhinav-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@abhinav-oai abhinav-oai changed the title Lazily resolve hostname for remote sandbox config inline hostname resolution for remote sandbox config Apr 27, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This not only addresses the regression but also simplifies the code quite a bit.

@abhinav-oai abhinav-oai enabled auto-merge (squash) April 27, 2026 02:57
@abhinav-oai abhinav-oai merged commit c3e6084 into main Apr 27, 2026
25 checks passed
@abhinav-oai abhinav-oai deleted the abhinav/lazy-remote-sandbox-hostname branch April 27, 2026 03:18
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants