Skip to content

feat: exec-server prep for unified exec#15691

Merged
jif-oai merged 24 commits intomainfrom
jif/exec-server-for-ue
Mar 26, 2026
Merged

feat: exec-server prep for unified exec#15691
jif-oai merged 24 commits intomainfrom
jif/exec-server-for-ue

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Mar 24, 2026

This PR partially rebase unified_exec on the exec-server and adapt the exec-server accordingly.

What changed in exec-server

  1. Replaced the old "broadcast-driven; process-global" event model with process-scoped session events. The goal is to be able to have dedicated handler for each process.
  2. Add to protocol contract to support explicit lifecycle status and stream ordering:
  • WriteResponse now returns WriteStatus (Accepted, UnknownProcess, StdinClosed, Starting) instead of a bool.
  • Added seq fields to output/exited notifications.
  • Added terminal process/closed notification.
  1. Demultiplexed remote notifications into per-process channels. Same as for the event sys
  2. Local and remote backends now both implement ExecBackend.
  3. Local backend wraps internal process ID/operations into per-process ExecProcess objects.
  4. Remote backend registers a session channel before launch and unregisters on failed launch.

What changed in unified_exec

  1. Added unified process-state model and backend-neutral process wrapper. This will probably disappear in the future, but it makes it easier to keep the work flowing on both side.
  • UnifiedExecProcess now handles both local PTY sessions and remote exec-server processes through a shared ProcessHandle.
  • Added ProcessState to track has_exited, exit_code, and terminal failure message consistently across backends.
  1. Routed write and lifecycle handling through process-level methods.

Some rationals

  1. The change centralizes execution transport in exec-server while preserving policy and orchestration ownership in core, avoiding duplicated launch approval logic. This comes from internal discussion.
  2. Session-scoped events remove coupling/cross-talk between processes and make stream ordering and terminal state explicit (seq, closed, failed).
  3. The failure-path surfacing (remote launch failures, write failures, transport disconnects) makes command tool output and cleanup behavior deterministic

Follow-ups:

  • Unify the concept of thread ID behind an obfuscated struct
  • FD handling
  • Full zsh-fork compatibility
  • Full network sandboxing compatibility
  • Handle ws disconnection
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

process: environment.get_executor(),

P2 Badge Fix integration tests to use the renamed environment API

This test still calls environment.get_executor(), but the commit renamed the API to get_exec_backend(). As written, the integration test target will not compile, so CI coverage for exec-session behavior is broken until tests are updated to the new interface.

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

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Mar 24, 2026

@codex review

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: 9e91c882fd

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

@jif-oai jif-oai merged commit 7dac332 into main Mar 26, 2026
59 of 64 checks passed
@jif-oai jif-oai deleted the jif/exec-server-for-ue branch March 26, 2026 14:22
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants