Skip to content

[3/8] Add pushed exec process events#18020

Open
aibrahim-oai wants to merge 1 commit intodev/remote-mcp-exec-stdinfrom
dev/remote-mcp-exec-events
Open

[3/8] Add pushed exec process events#18020
aibrahim-oai wants to merge 1 commit intodev/remote-mcp-exec-stdinfrom
dev/remote-mcp-exec-events

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

@aibrahim-oai aibrahim-oai commented Apr 15, 2026

Summary

  • Add a pushed ExecProcessEvent stream alongside retained process/read output.
  • Publish local and remote output, exit, close, and failure events.
  • Cover the event stream with shared local/remote exec process tests.

Testing

  • cargo check -p codex-exec-server
  • cargo check -p codex-rmcp-client
  • Not run: cargo test per repo instruction; CI will cover.

Stack

o  #18027 [8/8] Fail exec client operations after disconnect
│
o  #18025 [7/8] Cover MCP stdio tests with executor placement
│
o  #17974 [6/8] Wire remote MCP stdio through executor
│
o  #17987 [5/8] Add executor process transport for MCP stdio
│
o  #17986 [4/8] Abstract MCP stdio server launching
│
@  #18020 [3/8] Add pushed exec process events
│
o  #17985 [2/8] Support piped stdin in exec process API
│
o  #17984 [1/8] Add MCP server environment config
│
o  main

Co-authored-by: Codex <noreply@openai.com>
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: a5c217e55a

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

impl SessionState {
fn new() -> Self {
let (wake_tx, _wake_rx) = watch::channel(0);
let (event_tx, _event_rx) = broadcast::channel(PROCESS_EVENT_CHANNEL_CAPACITY);
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.

P1 Badge Buffer events until first subscriber attaches

SessionState::new creates a broadcast channel and immediately drops the initial receiver. If a short-lived process outputs/exits before subscribe_events() is called, publish_event drops those events (no receivers), yet the sender remains alive on the process handle. An event-only consumer can then wait forever for Exited/Closed, which is a functional hang.

Useful? React with 👍 / 👎.

@@ -645,6 +677,7 @@ async fn handle_server_notification(
let session = inner.remove_session(&params.process_id).await;
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.

P1 Badge Keep session routed until ordered terminal events arrive

On exec/closed, the client removes the session before forwarding the event. Server notifications are emitted from concurrent tasks, so closed can arrive before lower-seq exited/output notifications. After removal, those delayed notifications are dropped, so remote event subscribers can miss exit status or tail output.

Useful? React with 👍 / 👎.

@aibrahim-oai aibrahim-oai changed the title [3/6] Add pushed exec process events [3/7] Add pushed exec process events Apr 15, 2026
@aibrahim-oai aibrahim-oai changed the title [3/7] Add pushed exec process events [3/8] Add pushed exec process events Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant