Skip to content

V2: starting a foreground server blocks the agent indefinitely #50278

Open

Description

@taka6745

Description

If the agent starts Uvicorn in the foreground, the server starts successfully but the shell tool never returns while it is running. The agent is stuck waiting and cannot continue testing or fixing the app without intervention.

This is an indefinite block on a healthy server process, not a slow command. Recovery should not depend on the model remembering to request background execution.

Related to #34366 and #47350. Proposed v2 fix: #50276.

OpenCode version

2.0.11

Steps to reproduce

  1. In a project with a working ASGI app at app:app and Uvicorn installed, ask the agent to start the server and then check its HTTP response.
  2. Have the shell tool run uvicorn app:app --host 127.0.0.1 --port 8000 in the foreground, without background: true.
  3. Uvicorn starts and stays running. The shell tool keeps waiting, so the agent never gets to the HTTP check unless the server is stopped or the command is manually backgrounded.

Expected: the server can keep running while the agent continues its work.

Operating System

Ubuntu, x86_64

Activity

  1. changed the title [-]V2: foreground shell commands block the agent until they exit[/-] [+]V2: starting a foreground server blocks the agent indefinitely[/+] on Sep 21, 2026
  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and for putting together #50276!

    As far as I can tell from the v2 code, a foreground shell command blocking the agent is intended behaviour, not a bug. Foreground commands have a 2-minute default timeout, after which the process is killed and the model is told it timed out. The shell tool's description also tells the model to use background: true for dev servers, and a running command can be moved to the background by hand. So what you're describing is a request for the tool to move long-running foreground commands to the background automatically, so the agent doesn't depend on the model remembering to ask for it. Maintainers will consider it.

    If you saw a foreground uvicorn run for well over 2 minutes without being stopped (and the model hadn't passed timeout: 0), that would be a separate bug. Please add the session's tool call input and logs here if so.

    Related:

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions