Skip to content

Agent blocks indefinitely on long-running server processes, preventing continuation of workflow #6083

@SHAY5555-gif

Description

@SHAY5555-gif

What version of Codex is running?

Latest version (0.53)

What subscription do you have?

ChatGPT Plus

Which model were you using?

GPT-5-Codex

What platform is your computer?

Windows 11 x64

What issue are you seeing?

Issue Description

When Codex CLI starts a long-running server process (e.g., development servers like npm run dev, langgraph gdev, Django runserver, etc.), the agent blocks indefinitely and waits for the server to terminate before continuing with any other tasks.

This creates a critical workflow blocker because:

  1. The agent cannot continue - It sits idle showing "Working 10s...", "Working 20s..." etc., without performing any other operations
    1. Requires manual intervention - Users must repeatedly stop the agent (Ctrl+C) and restart it to continue development
    1. Breaks iterative workflow - Cannot ask the agent to start a server, then make code changes, then test the running server
    1. Affects all long-running processes - Any terminal command that doesn't exit (servers, watchers, monitoring tools) causes this behavior

Example Scenario

User asks: "Start the development server, then make changes to the API endpoints"

What happens:

  • Codex runs npm run dev or langgraph dev --port 8123
    • Server starts successfully and runs in foreground
      • Agent shows "Working 30s...", "Working 60s...", etc.
        • Agent never proceeds to make the requested code changes
          • User must kill Codex, restart it, manually keep server running in separate terminal, then ask again
            This makes Codex unusable for typical development workflows where servers run continuously while development happens.

What steps can reproduce the bug?

Reproduction Steps

Method 1: Simple Test with Python HTTP Server

  1. Open terminal and navigate to any directory
    1. Run codex
    1. Give prompt: "Start a Python HTTP server on port 8000, then create a new test.html file"
    1. Codex executes: python -m http.server 8000
    1. Server starts and runs indefinitely
    1. Observe: Agent shows "Working 10s...", "Working 30s...", "Working 60s..." etc.
    1. Observe: Agent NEVER proceeds to create test.html
    1. Must manually kill the agent with Ctrl+C

Method 2: Development Server (LangGraph example)

  1. In a LangGraph project directory
    1. Run codex
    1. Give prompt: "Start the LangGraph dev server, then update the agent configuration in langgraph.json"
    1. Codex executes: langgraph dev --port 8123
    1. Server starts successfully and displays ready message
    1. Observe: Agent blocks indefinitely on the running server
    1. Observe: Never proceeds to edit langgraph.json
    1. Must kill and restart agent to continue

Method 3: NPM Development Server

  1. In a Node.js/React project
    1. Run codex
    1. Give prompt: "Start the dev server and then fix the typo in App.js"
    1. Codex executes: npm run dev
    1. Dev server starts and shows "Compiled successfully"
    1. Observe: Agent waits indefinitely for npm process to exit
    1. Never proceeds to edit App.js

Affected Commands

Any long-running terminal process causes this:

  • npm run dev / npm start
    • python -m http.server
      • langgraph dev
        • flask run
          • django-admin runserver
            • nodemon
              • Watch commands (npm run watch, tsc --watch)
                • Monitoring tools

What is the expected behavior?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions