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
Description
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
- 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.
- Have the shell tool run
uvicorn app:app --host 127.0.0.1 --port 8000 in the foreground, without background: true.
- 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
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, 2026opencodejr commented on Oct 28, 2026
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:
neriousy commented on Nov 19, 2026
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.
Metadata
Metadata
Development
No branches or pull requestsIssue actions