Skip to content

[3/3] app-server: configure environment connection timeout#29025

Merged
sayan-oai merged 2 commits into
mainfrom
codex/environment-add-connect-timeout
Jun 19, 2026
Merged

[3/3] app-server: configure environment connection timeout#29025
sayan-oai merged 2 commits into
mainfrom
codex/environment-add-connect-timeout

Conversation

@sayan-oai

@sayan-oai sayan-oai commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Why

Remote environments registered through environment/add currently use the fixed 10-second WebSocket connection timeout. Slow-starting executors need a caller-selected connection window, but this should not add retry policy or couple exec-server behavior to Core’s deferred_executor feature.

Make the timeout an optional part of the existing experimental request. Existing clients continue using the current default, while callers that know an executor may take longer can request a larger window explicitly.

Depends on #28683.

What changed

  • Add optional connectTimeoutMs to EnvironmentAddParams and document it in the app-server README.
  • Pass the optional timeout through EnvironmentRequestProcessor into one EnvironmentManager::upsert_environment() path; the manager applies the existing default when it is omitted.
  • Preserve the existing single-attempt lifecycle. The configured value controls WebSocket connection and handshake time for both initial connection and later reconnects; initialization retains its separate timeout.
  • Add an app-server integration test that sends the real JSON-RPC request and verifies a stalled handshake observes the requested timeout.

Test plan

  • just test -p codex-app-server-protocol
  • just test -p codex-exec-server
  • just test -p codex-app-server environment_add_applies_connect_timeout

Rollout

This is additive and does not enable deferred_executor. Callers should send a non-default timeout only after a compatible app-server is deployed; omitted or null values retain the existing 10-second default.

Comment thread codex-rs/exec-server/src/environment.rs Outdated
environment_id: String,
exec_server_url: String,
) -> Result<(), ExecServerError> {
self.upsert_environment_with_connect_timeout(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

delete the proxy method

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if you need fallback make the parameter optional

@sayan-oai sayan-oai force-pushed the codex/environment-add-connect-timeout branch from d03ca11 to dae0347 Compare June 19, 2026 04:49
@sayan-oai sayan-oai requested a review from a team as a June 19, 2026 04:49
@sayan-oai sayan-oai force-pushed the codex/turn-environment-starting-snapshots branch from 253a6ba to bb8869d Compare June 19, 2026 04:52
Base automatically changed from codex/turn-environment-starting-snapshots to main June 19, 2026 05:06
@sayan-oai sayan-oai force-pushed the codex/environment-add-connect-timeout branch from dae0347 to bd2cc5b Compare June 19, 2026 05:07
@sayan-oai sayan-oai enabled auto-merge (squash) June 19, 2026 05:07
@sayan-oai sayan-oai merged commit f886e33 into main Jun 19, 2026
46 of 47 checks passed
@sayan-oai sayan-oai deleted the codex/environment-add-connect-timeout branch June 19, 2026 05:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 19, 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