You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Support interactive long-running commands / child processes #53895
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Describe the enhancement
Currently opencode can only run one-shot non-interactive shell commands.
When executing interactive long-running commands such as playwright-cli which spawn a browser, opencode will hang indefinitely.
The root cause: opencode waits for the child process to exit and return an exit code, but interactive commands keep running and do not terminate immediately.
I want opencode to support interactive / long-lived child processes:
Capture incremental stdout/stderr streaming output, instead of blocking and waiting for process exit
Allow handling interactive CLI tools that launch GUI applications (browser via playwright-cli)
Be able to continue task workflow while the child process remains alive
Use case
When opencode runs playwright-cli automation tasks:
The browser window opens successfully, but opencode hangs forever because playwright-cli keeps running as an interactive process and does not exit.
The agent cannot proceed with subsequent steps.
Benefit
This feature unlocks automation scenarios with playwright, cypress and other GUI/long-running CLI tools.
It extends opencode's capability beyond short-lived one-shot shell commands.
To restate it: you'd like OpenCode to handle long-lived and interactive child processes such as playwright-cli. That means streaming their output as it arrives, keeping them running, and letting the agent carry on instead of waiting for the process to exit.
You didn't mention a version. If you're on v1 (opencode-ai, 0.x/1.x), much of this already works in v2 (@opencode/cli):
The shell tool takes background: true. The command returns at once with a shell ID, its output is streamed to a file the agent can read while it runs, and the session is notified when the process exits. This is meant for dev servers, browsers and other long-running tools, so asking the agent to start playwright-cli in the background should stop the hang.
Foreground commands have a default 2-minute timeout, so they don't block forever.
What v2 doesn't support yet is sending input to a process that is still running (driving a REPL or interactive prompt). Maintainers will consider that part. Related issues and PRs:
If you're already on v2 and playwright-cli still hangs even when run in the background, please reply with your opencode --version, OS and the exact command, since that would be a bug.
OpenCode v2 handles this now: the shell tool accepts background: true, returns at once with a shell ID, streams the process output to a file the agent can read while it runs, and notifies the session when the process exits; foreground commands that outlive their timeout are moved to the background instead of hanging. If a long-running tool like playwright-cli still blocks the agent on the latest version, comment here and we'll reopen.
Activity
opencode-agent commentedon Oct 8, 2026
Thanks for the request, @guangyihan!
To restate it: you'd like OpenCode to handle long-lived and interactive child processes such as
playwright-cli. That means streaming their output as it arrives, keeping them running, and letting the agent carry on instead of waiting for the process to exit.You didn't mention a version. If you're on v1 (
opencode-ai, 0.x/1.x), much of this already works in v2 (@opencode/cli):background: true. The command returns at once with a shell ID, its output is streamed to a file the agent can read while it runs, and the session is notified when the process exits. This is meant for dev servers, browsers and other long-running tools, so asking the agent to startplaywright-cliin the background should stop the hang.What v2 doesn't support yet is sending input to a process that is still running (driving a REPL or interactive prompt). Maintainers will consider that part. Related issues and PRs:
interactive_*tools that run a process under a PTY and let the agent write to itplaywright-cliin v1If you're already on v2 and
playwright-clistill hangs even when run in the background, please reply with youropencode --version, OS and the exact command, since that would be a bug.neriousy commentedon Nov 19, 2026
OpenCode v2 handles this now: the shell tool accepts
background: true, returns at once with a shell ID, streams the process output to a file the agent can read while it runs, and notifies the session when the process exits; foreground commands that outlive their timeout are moved to the background instead of hanging. If a long-running tool like playwright-cli still blocks the agent on the latest version, comment here and we'll reopen.