GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — V2: starting a foreground server blocks the agent indefinitely · Issue #50278 · anomalyco/opencode

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

New issue
Copy link
New issue
Copy link
Closed
#60375
Closed
V2: starting a foreground server blocks the agent indefinitely#50278
#60375
Copy link

Description

@taka6745
taka6745
opened on Sep 21, 2026
Issue body actions

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. taka6745
    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
    opencodejrBot
    on Oct 28, 2026
    Contributor
    More actions

    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:

    • fix(core): background long-running shell commands #50276: your PR that auto-backgrounds commands after 5 seconds (closed by automated cleanup)
    • V2: define shell backgrounding semantics #34366: the original v2 shell backgrounding design (opt-in background option)
    • Shell tool never returns when a command leaves a background process holding its stdio #47350: an older v1 hang caused by processes holding the shell's stdio, a different cause
  3. neriousy commented on Nov 19, 2026

    @neriousy
    neriousy
    on Nov 19, 2026
    Member
    More actions

    Fixed by #63024 and #63699: since v2.3.0, a foreground shell command still running at its timeout moves to the background instead of blocking the agent. If you still see this on the latest version, comment here and we'll reopen.

  4. neriousy
    closed this as completedon Nov 19, 2026
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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.