Skip to content

[FEATURE]: Support interactive long-running commands / child processes #53895

Closed

Description

@guangyihan

Feature hasn't been suggested before.

  • 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:

  1. Capture incremental stdout/stderr streaming output, instead of blocking and waiting for process exit
  2. Allow handling interactive CLI tools that launch GUI applications (browser via playwright-cli)
  3. 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.

Activity

  1. opencode-agent commented on Oct 8, 2026

    @opencode-agent
    Contributor

    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):

    • 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.

  2. neriousy commented on Nov 19, 2026

    @neriousy
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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