Skip to content

Add cloud executor registration to exec-server#19575

Merged
miz-openai merged 10 commits intomainfrom
codex/exec-server-cloud-registration
May 5, 2026
Merged

Add cloud executor registration to exec-server#19575
miz-openai merged 10 commits intomainfrom
codex/exec-server-cloud-registration

Conversation

@miz-openai
Copy link
Copy Markdown
Contributor

Summary

This PR adds the first codex-rs milestone for remote-exec e2e: a local codex exec-server can now register itself with codex-cloud-environments and attach to the returned rendezvous websocket.

At a high level, codex exec-server --cloud ... now:

  • loads ChatGPT auth from normal Codex config
  • registers an executor with codex-cloud-environments
  • receives a signed rendezvous websocket URL
  • serves the existing exec-server JSON-RPC protocol over that websocket

What Changed

  • Added --cloud, --cloud-base-url, --cloud-environment-id, and --cloud-name to codex exec-server
  • Added a new exec-server/src/cloud.rs module that handles:
    • registration requests
    • auth/header setup
    • bounded auth retry on 401/403
    • reconnect/backoff after websocket disconnects
  • Reused the existing ConnectionProcessor / ExecServerHandler path so cloud mode serves the same exec/filesystem RPC surface as local websocket mode
  • Added cloud-specific error variants and minimal docs for the new mode

Testing

Manual e2e test that fully goes through exec server flow with our codex cloud agent as orchestrator

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 25, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@miz-openai
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Apr 25, 2026
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1869c17b83

ℹ️ 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".

Comment thread codex-rs/exec-server/src/cloud.rs Outdated
Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 26, 2026
- anomalyco/opencode#24465: ecosystem table row (merge-as-is)
- openai/codex#19575: cloud-executor first milestone (merge-after-nits)
- BerriAI/litellm#26533: MCP semantic filter suffix-match (merge-after-nits)
Comment thread codex-rs/cli/src/main.rs Outdated
Comment thread codex-rs/exec-server/src/cloud.rs Outdated
}

sleep(backoff).await;
backoff = (backoff * 2).min(Duration::from_secs(30));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If possible, avoid inlining the retry logic here and use a retry policy + wrapped function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That said, I could see the divergence here being different enough to warrant a separate path, so not a blocker for now

Comment thread codex-rs/exec-server/src/cloud.rs Outdated

/// Register an exec-server with cloud environments and serve requests over the
/// returned rendezvous websocket.
pub async fn run_cloud_executor(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice if this and the existing main were collapsed - the main difference is the connection setup, but otherwise request handling from thereafter is the same. Eventually we would want to have shared signal handling, or other setup

Comment thread codex-rs/cli/src/main.rs Outdated
Comment thread codex-rs/cli/src/main.rs Outdated
@miz-openai miz-openai force-pushed the codex/exec-server-cloud-registration branch from bcebd89 to c1d9533 Compare April 28, 2026 01:00
@miz-openai miz-openai enabled auto-merge (squash) April 28, 2026 04:31
@miz-openai miz-openai force-pushed the codex/exec-server-cloud-registration branch from 281f31b to fb4a992 Compare May 5, 2026 21:37
@miz-openai miz-openai merged commit d0f9d5e into main May 5, 2026
26 checks passed
@miz-openai miz-openai deleted the codex/exec-server-cloud-registration branch May 5, 2026 22:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 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