Skip to content

Windows: /mcp prints taskkill “SUCCESS” process termination logs #20845

Closed

Description

@RE-codes

What version of Codex CLI is running?

codex-cli 0.128.0

What OS and shell are you using?

  • Windows 11
  • PowerShell

What steps can reproduce the bug?

  1. Configure an MCP server (e.g. Context7)
  2. Start Codex CLI
  3. Run /mcp

What is the expected behavior?

/mcp should display MCP server status without OS-level process logs.


What is the actual behavior?

    SUCCESS: The process with PID 14276 (child process of PID 5280) has been terminated.
    SUCCESS: The process with PID 5280 (child process of PID 14200) has been terminated.
    SUCCESS: The process with PID 14200 (child process of PID 14748) has been terminated.
    SUCCESS: The process with PID 14748 (child process of PID 2024) has been terminated.

appear every time /mcp is run.


Additional context

  • Context7 MCP server works correctly; this is cosmetic noise
  • Reproduces with:
    • npx directly
    • cmd /c npx
    • custom env
    • startup_timeout_ms
  • This appears to be Windows-specific (not observed under WSL2)

Impact

Low functional impact, but degrades CLI UX—especially when /mcp is used frequently.

Activity

  1. added
    bug
    CLI
    windows-os
    mcp
    on May 3, 2026
  2. added
    TUI
    and removed
    CLI
    on May 3, 2026
  3. dupl commented on May 3, 2026

    @dupl

    I encountered the same problem.

  4. AspirinMX commented on May 3, 2026

    @AspirinMX

    Same issue:

    Image Image

    Relevant code:

    The Windows termination path currently appears to invoke taskkill without redirecting its stdio, see codex-rs/rmcp-client/src/stdio_server_launcher.rs:

    #[cfg(windows)]
    fn terminate(&self) {
        let _ = std::process::Command::new("taskkill")
            .arg("/PID")
            .arg(self.pid.to_string())
            .arg("/T")
            .arg("/F")
            .status();
    }

    Since no stdio is specified, taskkill inherits Codex's stdout/stderr. As a result, taskkill status messages are printed directly into the terminal used by the TUI.

    Possible fix:

    Redirect the taskkill process stdio to null:

    #[cfg(windows)]
    fn terminate(&self) {
        use std::process::{Command, Stdio};
    
        let _ = Command::new("taskkill")
            .arg("/PID")
            .arg(self.pid.to_string())
            .arg("/T")
            .arg("/F")
            .stdin(Stdio::null())
            .stdout(Stdio::null())
            .stderr(Stdio::null())
            .status();
    }

    Optionally, also set CREATE_NO_WINDOW on Windows:

    #[cfg(windows)]
    fn terminate(&self) {
        use std::os::windows::process::CommandExt;
        use std::process::{Command, Stdio};
    
        const CREATE_NO_WINDOW: u32 = 0x08000000;
    
        let _ = Command::new("taskkill")
            .arg("/PID")
            .arg(self.pid.to_string())
            .arg("/T")
            .arg("/F")
            .stdin(Stdio::null())
            .stdout(Stdio::null())
            .stderr(Stdio::null())
            .creation_flags(CREATE_NO_WINDOW)
            .status();
    }
  5. dupl commented on May 4, 2026

    @dupl

    @etraut-openai Please fix this bug. Thank you so much!

  6. zhao004 commented on May 4, 2026

    @zhao004
    Image

    Same problem

  7. AngeloTadeucci commented on May 5, 2026

    @AngeloTadeucci

    Same. thread ID 019df5b9-d5f8-77a3-8629-36c48d1879b1

  8. falvarez1 commented on May 5, 2026

    @falvarez1

    Same... version codex-cli 0.128.0

    Image
  9. dupl commented on May 6, 2026

    @dupl

    @rhan-oai Please fix this bug. Thank you so much!

  10. dupl commented on May 6, 2026

    @dupl

    @fcoury-oai Please fix this bug. Thank you so much!

  11. AspirinMX commented on May 7, 2026

    @AspirinMX

    Fixing this bug could still take a long time; this repository does not accept PRs from external contributors, and there are currently over 3,000 open issues.

  12. AspirinMX commented on May 7, 2026

    @AspirinMX

    Currently, in the latest version of Codex, if this issue occurs, you can resize the terminal window; this triggers a re-layout of the Codex TUI, thereby clearing the stdout output by taskkill that has leaked into the TUI.

  13. Chris0Jeky commented on May 10, 2026

    @Chris0Jeky

    As of today (May 10) the issue is still present for me and triggers regularly

    Image
  14. added a commit that references this issue on May 10, 2026
    e5d0222
  15. added 3 commits that reference this issue on May 13, 2026
    e275f85
    e4cb7a7
    cb5f35a
  16. added a commit that references this issue on Jun 27, 2026
    23a13e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIbugmcpwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions